A continuation of HomeBox the inventory and organization system built for the Home User
Refactor update-currencies workflow with enhancements
Katosb535cdeb968c
diff --git a/.github/workflows/update-currencies.yml b/.github/workflows/update-currencies.ymlindex aad405c8..b5bc3965 100644--- a/.github/workflows/update-currencies.yml+++ b/.github/workflows/update-currencies.yml@@ -5,18 +5,22 @@ on:branches: [ main ]workflow_dispatch:+permissions:+ contents: write+ pull-requests: write+jobs:update-currencies:runs-on: ubuntu-lateststeps:- name: Checkout code- uses: actions/checkout@v3+ uses: actions/checkout@v4with:fetch-depth: 0- name: Set up Python- uses: actions/setup-python@v4+ uses: actions/setup-python@v5with:python-version: '3.8'cache: 'pip'@@ -25,15 +29,14 @@ jobs:- name: Install dependenciesrun: |python -m pip install --upgrade pip- pip install requests+ pip install -r .github/workflows/update-currencies/requirements.txt- name: Run currency update scriptrun: python .github/scripts/update_currencies.py- - name: Check for file changes- id: changes+ - name: Check for currencies.json changesrun: |- if git diff --quiet; then+ if git diff --quiet -- backend/internal/core/currencies/currencies.json; thenecho "changed=false" >> $GITHUB_ENVelseecho "changed=true" >> $GITHUB_ENV@@ -41,16 +44,17 @@ jobs:- name: Create Pull Requestif: env.changed == 'true'- uses: peter-evans/[email protected]+ uses: peter-evans/create-pull-request@v7with:token: ${{ secrets.GITHUB_TOKEN }}branch: update-currenciesbase: maintitle: "Update currencies.json"commit-message: "chore: update currencies.json"- path: backend/internal/core/currencies/currencies.json+ path: .+ add-paths: |+ backend/internal/core/currencies/currencies.json- name: No updates neededif: env.changed == 'false'run: echo "✅ currencies.json is already up-to-date"-