File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,23 @@ jobs:
19
19
git add -A \*.html &&
20
20
git diff-index --cached --exit-code HEAD -- ||
21
21
echo "need-to-commit=yes" >>$GITHUB_OUTPUT
22
- - name : commit & push
22
+ - name : commit
23
23
if : steps.check.outputs.need-to-commit == 'yes'
24
24
run : |
25
25
git config user.name "${{github.actor}}" &&
26
26
git config user.email "${{github.actor}}@users.noreply.github.com" &&
27
27
git commit -m 'Convert Markdown to HTML' -- \*.html &&
28
28
git update-index --refresh &&
29
29
git diff-files --exit-code &&
30
- git diff-index --cached --exit-code HEAD -- &&
31
- git push
32
-
30
+ git diff-index --cached --exit-code HEAD --
31
+ - name : commit
32
+ if : steps.check.outputs.need-to-commit == 'yes' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
33
+ run : git push
34
+ - name : publish temporary branch and add instructions how to fetch
35
+ if : steps.check.outputs.need-to-commit == 'yes' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
36
+ run : |
37
+ auth="$(printf 'PAT:%s' '${{ secrets.GITHUB_TOKEN }}' | base64 -w 0)" &&
38
+ echo "::add-mask::$auth" &&
39
+ git -c http.extraHeader="Authorization: Basic $auth" push "${{ github.event.pull_request.base.repo.clone_url }}" HEAD:refs/tmp/pr-${{ github.event.number }} &&
40
+ echo '::error::HTML pages are out of date. Please call `git pull --ff-only ${{ github.event.pull_request.base.repo.clone_url }}" refs/tmp/pr-${{ github.event.number }}` and push to the PR branch' >&2
41
+ exit 1
You can’t perform that action at this time.
0 commit comments