File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 - name : Install dependencies
2222 run : pip install --break-system-packages -r requirements.txt
2323
24+ - name : Get Previous Run ID
25+ continue-on-error : true
26+ id : get_id
27+ env :
28+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29+ run : |
30+ # Fetches the ID of the last completed run for the current workflow
31+ PREVIOUS_RUN_ID=$(gh run list \
32+ --branch "${{ github.ref_name }}" \
33+ --workflow "${{ github.workflow }}" \
34+ --status success \
35+ --limit 1 \
36+ --json databaseId \
37+ --jq '.[0].databaseId')
38+ echo "previous_run_id=$PREVIOUS_RUN_ID" >> "$GITHUB_OUTPUT"
39+
40+ - name : Download previous database artifact
41+ uses : actions/download-artifact@v8
42+ with :
43+ name : database.json
44+ github-token : ${{ secrets.GITHUB_TOKEN }}
45+ run-id : ${{ steps.get_id.outputs.previous_run_id }}
46+ continue-on-error : true
47+
2448 - name : Call RescueGroups API
2549 env :
2650 CUTEPETSBOSTON_RESCUEGROUPS_API_KEY : ${{ secrets.CUTEPETSBOSTON_RESCUEGROUPS_API_KEY }}
3256 SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
3357 APP_ENV : prod
3458 run : python ./main.py
59+
60+ - name : Upload database artifact
61+ uses : actions/upload-artifact@v7
62+ with :
63+ path : database.json
64+ retention-days : 14
65+ archive : false
You can’t perform that action at this time.
0 commit comments