rusefi/.github/workflows/custom-board-update-rusefi-...

62 lines
1.7 KiB
YAML
Raw Normal View History

2023-12-01 20:46:13 -08:00
#
#
#
name: Update rusEFI Reference
on:
workflow_call:
jobs:
update-git:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Git Checkout Submodules
run: |
git submodule update --init --depth=1 ext/rusefi
2024-06-01 06:59:44 -07:00
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Fetch remote lts-* branches of rusefi submodule
working-directory: ext/rusefi
run: |
git fetch --depth=1 origin '+refs/heads/lts-*:refs/remotes/origin/lts-*'
git branch -r
2023-12-01 20:46:13 -08:00
- name: Git Update Submodules
run: |
git submodule update --remote
2024-06-01 10:24:07 -07:00
- name: Commit fresh 'ext/rusefi' submodule
2023-12-01 20:46:13 -08:00
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub git update Action"
git add ext/rusefi
2024-01-06 15:14:39 -08:00
OUT=$(git commit -am "GHA says update ext/rusefi 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
2023-12-01 20:46:13 -08:00
git status
- name: Push
if: ${{ env.NOCOMMIT != 'true'}}
2023-12-01 20:46:13 -08:00
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
2024-06-01 10:46:41 -07:00
branch: ${{ github.ref }}