Skip to content

Commit

Permalink
Checking for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelorodrigo committed Dec 18, 2024
1 parent dfeca48 commit b6adb2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/update-indexes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ jobs:
run: yarn install --immutable --immutable-cache --check-cache
- name: Update indicadores.json
run: yarn update-indexes
- name: Checking for changes
id: check_changes
run: |
if git diff --exit-code assets/indicadores.json; then
echo "has_changes=false" >> $GITHUB_ENV
else
echo "has_changes=true" >> $GITHUB_ENV
- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add assets/indicadores.json
git commit -m 'Update indicadores.json with latest values'
git commit -m "Update indicadores.json"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions assets/indicadores.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"title": "Poupança",
"description": "Depósitos de poupança a partir de 04.05.2012 - Rentabilidade no período",
"unitDisplay": "% a.m.",
"value": 0.6291
"value": 10.6291
},
"selic": {
"title": "SELIC",
"description": "Taxa de juros - Selic anualizada base 252",
"unitDisplay": "% a.a.",
"value": 12.25
"value": 112.25
},
"cdi": {
"title": "CDI",
"description": "Taxa de juros - CDI anualizada base 252",
"unitDisplay": "% a.a.",
"value": 10.340000000000002
"value": 110.340000000000002
}
}

0 comments on commit b6adb2a

Please sign in to comment.