Update wideband Reference #61
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # todo: reduce copy-paste with update-libfirmware-reference.yaml | |
| name: Update wideband Reference | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '45 0 * * *' | |
| jobs: | |
| update-git: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Git Checkout Submodules | |
| run: | | |
| git submodule update --init firmware/controllers/can/wideband_firmware | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - name: Git Update Submodules | |
| run: | | |
| git submodule update --remote | |
| - name: Commit fresh 'firmware/controllers/can/wideband_firmware' submodule | |
| env: | |
| ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub wideband_firmware update Action" | |
| git add firmware/controllers/can/wideband_firmware | |
| OUT=$(git commit -am "GHA says update wideband_firmware submodule" 2>&1) || echo "commit failed, finding out why" | |
| if echo "$OUT" | grep 'nothing to commit'; then | |
| echo "submodule: looks like nothing to commit" | |
| echo "NOCOMMIT=true" >> $GITHUB_ENV | |
| exit 0 | |
| elif echo "$OUT" | grep 'changed'; then | |
| echo "submodule: looks like something has changed" | |
| else | |
| echo "submodule: looks like something unexpected" | |
| exit 1 | |
| fi | |
| git status | |
| - name: Push | |
| if: ${{ env.NOCOMMIT != 'true'}} | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ github.token }} | |
| branch: ${{ github.ref }} |