Skip to content

Commit d8c6cec

Browse files
committed
1 parent c34f7cb commit d8c6cec

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ env:
1717
jobs:
1818
update:
1919
runs-on: ubuntu-latest
20+
outputs:
21+
commit_hash: ${{ steps.commit-and-push.outputs.commit_hash }}
22+
2023
steps:
2124
- uses: actions/checkout@v3
2225
- name: Update Dockerfile
@@ -42,20 +45,11 @@ jobs:
4245
4346
END
4447
45-
- name: Commit updates
46-
run: |
47-
if [ -n "$(git status --porcelain)" ]; then
48-
git config --local user.email "workflow@github.com"
49-
git config --local user.name "GitHub Workflow"
50-
git add -A
51-
git commit -m "Apply updates from Nginx repository"
52-
fi
53-
54-
- name: Push changes
55-
uses: ad-m/github-push-action@master
48+
- name: Commit and push changes
49+
id: commit-and-push
50+
uses: stefanzweifel/git-auto-commit-action@v4
5651
with:
57-
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
force: true
52+
commit_message: Apply updates from Nginx repository
5953

6054
build:
6155
needs: update
@@ -64,10 +58,13 @@ jobs:
6458
contents: read
6559
packages: write
6660
id-token: write
61+
6762
steps:
6863
- name: Checkout repository
6964
uses: actions/checkout@v3
70-
65+
with:
66+
ref: ${{ needs.update.outputs.commit_hash }}
67+
7168
- name: Install cosign
7269
if: github.event_name != 'pull_request'
7370
uses: sigstore/cosign-installer@main

0 commit comments

Comments
 (0)