Skip to content

Commit 6ec98a3

Browse files
authored
Update 11ty-publish workflow to use git-auto-commit-action (#4154)
This update resolves spurious errors in the publish workflow in cases where a merge to `main` results in no changes to push to `gh-pages`. - [Example of the type of error this addresses](https://github.com/kfranqueiro/wcag/actions/runs/12036136821/job/33556666057) - [Example of the same type of run succeeding with this change](https://github.com/kfranqueiro/wcag/actions/runs/12036196134/job/33556861412) - [Example of a run completing with this change, operating as usual when there are changes to commit to `gh-pages`](https://github.com/kfranqueiro/wcag/actions/runs/12036639462/job/33558323786)
1 parent aa43153 commit 6ec98a3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/11ty-publish.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ jobs:
3636
curl https://labs.w3.org/spec-generator/?type=respec"&"url=https://raw.githack.com/$GITHUB_REPOSITORY/main/requirements/22/index.html -o _site/requirements/22/index.html -f --retry 3
3737
curl https://labs.w3.org/spec-generator/?type=respec"&"url=https://raw.githack.com/$GITHUB_REPOSITORY/main/conformance-challenges/index.html -o _site/conformance-challenges/index.html -f --retry 3
3838
- name: Push
39-
working-directory: _site
40-
run: |
41-
git config user.email [email protected]
42-
git config user.name w3cgruntbot
43-
git add -A .
44-
git commit -m ":robot: Deploy to GitHub Pages: $GITHUB_SHA from branch $GITHUB_REF"
45-
git push origin gh-pages
39+
uses: stefanzweifel/git-auto-commit-action@v5
40+
with:
41+
repository: _site
42+
branch: gh-pages
43+
commit_user_name: w3cgruntbot
44+
commit_user_email: [email protected]
45+
commit_author: "w3cgruntbot <[email protected]>"
46+
commit_message: ":robot: Deploy to GitHub Pages: ${{ github.sha }} from branch ${{ github.ref }}"
47+
skip_fetch: true
48+
skip_checkout: true

0 commit comments

Comments
 (0)