File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 7
7
jobs :
8
8
build :
9
9
runs-on : ubuntu-latest
10
+ outputs :
11
+ commit-info : ${{ steps.commit-info.outputs.COMMIT_INFO }}
10
12
steps :
11
13
- uses : actions/checkout@v4
12
14
with :
64
66
with :
65
67
path : site
66
68
69
+ - name : Generate commit info
70
+ id : commit-info
71
+ run : |
72
+ git log -1 --pretty="COMMIT_INFO=%an: [%h] %s" >> "$GITHUB_OUTPUT"
73
+
67
74
deploy :
68
75
needs : build
69
76
if : github.ref == 'refs/heads/master'
@@ -88,15 +95,14 @@ jobs:
88
95
89
96
- name : Push site to gh-pages branch
90
97
run : |
91
- CINFO="$(git log -1 --pretty="%an: [%h] %s")"
92
98
git clone --depth=1 --branch=gh-pages --single-branch --no-checkout \
93
- "https://${GITHUB_ACTOR} :${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY }.git" test
99
+ "https://${{ github.actor }} :${{ github.token }}@github.com/${{ github.repository } }.git" test
94
100
mv test/.git site/.git && rmdir test/
95
101
pushd site/ &>/dev/null
96
102
git add -A
97
103
git -c user.name=GitHub -c [email protected] commit \
98
104
-m "Auto deploy from GitHub Actions build ${GITHUB_RUN_NUMBER}" \
99
- -m "$CINFO " \
105
+ -m "${{ needs.build.outputs.commit-info }} " \
100
106
--allow-empty
101
107
git push
102
108
popd &>/dev/null
You can’t perform that action at this time.
0 commit comments