mirror of
https://github.com/Viren070/guides.git
synced 2025-12-01 23:16:16 +01:00
ci: ....
This commit is contained in:
@@ -8,8 +8,6 @@ on:
|
||||
jobs:
|
||||
generate-currency-rates:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
CHANGES_DETECTED: ${{ steps.check_changes.outputs.CHANGES_DETECTED }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -40,43 +38,9 @@ jobs:
|
||||
env:
|
||||
EXCHANGE_RATE_API_KEY: ${{ secrets.EXCHANGE_RATE_API_KEY }}
|
||||
|
||||
- name: Check for changes
|
||||
id: check_changes
|
||||
run: |
|
||||
# Configure git
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
|
||||
# Add changes
|
||||
git add static/currency_rates.json
|
||||
|
||||
# Check for changes
|
||||
if git diff-index --quiet HEAD --; then
|
||||
echo "No changes to commit"
|
||||
echo "CHANGES_DETECTED=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
else
|
||||
# Commit and push changes
|
||||
git commit -m 'chore: update currency rates'
|
||||
git push origin chore/update-currency-rates
|
||||
echo "CHANGES_DETECTED=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
|
||||
create-pull-request:
|
||||
runs-on: ubuntu-latest
|
||||
needs: generate-currency-rates
|
||||
steps:
|
||||
|
||||
- name: Checkout repository
|
||||
if: ${{ needs.generate-currency-rates.outputs.CHANGES_DETECTED == 'true' }}
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create Pull Request
|
||||
if: ${{ needs.generate-currency-rates.outputs.CHANGES_DETECTED == 'true' }}
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: 'chore: update currency rates'
|
||||
branch: chore/update-currency-rates
|
||||
signoff: true
|
||||
|
||||
Reference in New Issue
Block a user