Skip to content

Check outdated build db #1

Check outdated build db

Check outdated build db #1

Workflow file for this run

name: Check outdated build db
on:
workflow_dispatch:
schedule:
- cron: '32 5 * * 3'
jobs:
compare_files:
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build db
run: |
python3 scripts/create_app_list/main.py --full_output_file out.json --access_token ${{ secrets.GH_ACCESS_TOKEN }}
- name: Upload file
uses: actions/upload-artifact@v3
with:
name: out.json
path: out.json
if-no-files-found: error
- name: Compare Files
run: |
# Compare two files using diff
diff -q out.json input_files/input.json
# Store the exit code of the diff command
DIFF_EXIT_CODE=$?
# If exit code is 0, files are the same; if not, they are different
if [ $DIFF_EXIT_CODE -ne 0 ]; then
echo "Files are different!"
exit 1 # Fail the workflow
else
echo "Files are the same!"
fi
- name: Send custom JSON data to Slack workflow
if: ${{ failure() }} && ${{ github.event_name == 'schedule' }}
id: slack
uses: slackapi/[email protected]
with:
payload-file-path: slack.json
payload: |
{
"title": "Check input list",
"status": ":red-cross: Fail",
"status_detail": ":alert: Please update input file ! "
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}