Skip to content

Check outdated build db #3

Check outdated build db

Check outdated build db #3

Workflow file for this run

name: Check outdated build db
on:
workflow_dispatch:
inputs:
create_pr:
type: boolean
required: false
default: false
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 }}
- name: Commit and push changes
#if: ${{ failure() && (github.event_name == 'schedule' || inputs.create_pr == true) }}
run: |
git config --global user.name "Ledger App Tester Bot"
git config --global user.email "[email protected]"
git checkout -b update-input
echo "COucou" > out.json
cp out.json input_files/input.json
git add input_files/input.json
git commit -m "[auto] Update input file"
git push --set-upstream origin update-input
- name: Create Pull Request
run: |
gh pr create --base ${{ github.head_ref }} --head "update-input" --title "New PR with a file" --body "This PR adds a new file."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}