updated to use settings for branch selection

This commit is contained in:
Dustin Loring
2024-12-15 12:56:25 -05:00
parent 348f396d32
commit 69b1dc4c9a
6 changed files with 55 additions and 35 deletions

View File

@@ -3,7 +3,7 @@ name: Update Commit Hash File
on:
push:
branches:
- 'main'
- main
permissions:
contents: write
@@ -20,17 +20,14 @@ jobs:
- name: Get the latest commit hash
run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Get the current branch name
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Update commit file
run: |
echo "{ \"commit\": \"$COMMIT_HASH\", \"branch\": \"$BRANCH_NAME\" }" > app/commit.json
echo "{ \"commit\": \"$COMMIT_HASH\" }" > app/commit.json
- name: Commit and push the update
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add app/commit.json
git commit -m "chore: update commit hash to $COMMIT_HASH on branch $BRANCH_NAME"
git push
git commit -m "chore: update commit hash to $COMMIT_HASH"
git push