diff --git a/.github/workflows/custom-board-update-kicad6-library-reference.yaml b/.github/workflows/custom-board-update-kicad6-library-reference.yaml new file mode 100644 index 0000000..238474c --- /dev/null +++ b/.github/workflows/custom-board-update-kicad6-library-reference.yaml @@ -0,0 +1,50 @@ +# +# +# + +name: Update kicad6-library 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 kicad6-libraries + + - name: Git Update Submodules + run: | + git submodule update --remote + + - name: Commit fresh submodules + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub git kicad6-libraries update Action" + git add kicad6-library + OUT=$(git commit -am "GHA says update kicad6-libraries" 2>&1) || echo "commit failed, finding out why" + if echo "$OUT" | grep 'nothing to commit'; then + echo "hellen-one: looks like nothing to commit" + echo "NOCOMMIT=true" >> $GITHUB_ENV + exit 0 + elif echo "$OUT" | grep 'changed'; then + echo "hellen-one: looks like something has changed" + exit 0 + else + echo "hellen-one: 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 }}