Skip to content

Commit

Permalink
Modified Publish workflow: COMMIT_HASH is now saved to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
1NepuNep1 committed Jan 20, 2025
1 parent 823827b commit 61dcffb
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,21 @@ jobs:
with:
fetch-depth: 0

- name: Update COMMIT_HASH in Makefile
if: ${{ github.event.inputs.commit-hash != 'default' }}
run: |
sed -i 's/^COMMIT_HASH ?=.*/COMMIT_HASH ?= '${{ github.event.inputs.commit-hash }}'/' Makefile
- name: Build & test (always)
run: |
if [ "${{ github.event.inputs.commit-hash }}" = "default" ]; then
make all
else
make all COMMIT_HASH=${{ github.event.inputs.commit-hash }}
fi
make all
git status
- name: Publish (optional)
if: ${{ github.event.inputs.commit-hash != 'default' }}
run: |
echo "Publishing changes..."
git config --global user.email "robot@umbrella";
git config --global user.name "robot";
git config --global user.email "robot@umbrella"
git config --global user.name "robot"
git commit -am "Auto-update with COMMIT_HASH=${{ github.event.inputs.commit-hash }}" || echo "Nothing to commit"
git push

0 comments on commit 61dcffb

Please sign in to comment.