File tree Expand file tree Collapse file tree 7 files changed +39
-10
lines changed
Expand file tree Collapse file tree 7 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ cp -Rf ${SOURCE}/admin/starter/. ./
3232# Commit the changes
3333git add .
3434git commit -m " Release ${RELEASE} "
35- git push
35+ bash ${SOURCE} /.github/scripts/secure-git- push https://github.com/codeigniter4/appstarter.git HEAD:master
Original file line number Diff line number Diff line change @@ -34,4 +34,4 @@ cp -Rf ${SOURCE}/admin/starter/tests/. ./tests/
3434# Commit the changes
3535git add .
3636git commit -m " Release ${RELEASE} "
37- git push
37+ bash ${SOURCE} /.github/scripts/secure-git- push https://github.com/codeigniter4/framework.git HEAD:master
Original file line number Diff line number Diff line change @@ -58,4 +58,4 @@ touch ${TARGET}/docs/.nojekyll
5858# Commit the changes
5959git add .
6060git commit -m " Release ${RELEASE} "
61- git push
61+ bash ${SOURCE} /.github/scripts/secure-git- push https://github.com/codeigniter4/userguide.git HEAD:master
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ if [[ $# -ne 2 ]]; then
6+ echo " Usage: secure-git-push <remote-url> <refspec>" >&2
7+ exit 1
8+ fi
9+
10+ if [[ -z " ${PUSH_TOKEN:- } " ]]; then
11+ echo " PUSH_TOKEN is required" >&2
12+ exit 1
13+ fi
14+
15+ REMOTE_URL=" $1 "
16+ REFSPEC=" $2 "
17+ AUTH_HEADER=" $( printf ' x-access-token:%s' " ${PUSH_TOKEN} " | base64 | tr -d ' \n' ) "
18+
19+ echo " ::add-mask::${AUTH_HEADER} "
20+ git -c http.https://github.com/.extraheader=" AUTHORIZATION: basic ${AUTH_HEADER} " push " ${REMOTE_URL} " " ${REFSPEC} "
21+
22+ unset AUTH_HEADER PUSH_TOKEN
Original file line number Diff line number Diff line change 6868
6969 - name : Deploy to API repo
7070 working-directory : api
71+ env :
72+ PUSH_TOKEN : ${{ secrets.ACCESS_TOKEN }}
7173 run : |
7274 git add .
7375 if ! git diff-index --quiet HEAD; then
7476 git commit -m "Updated API for commit ${GITHUB_SHA}"
75- git push origin master
77+ bash ${GITHUB_WORKSPACE}/.github/scripts/secure-git- push https://github.com/codeigniter4/api.git HEAD: master
7678 fi
Original file line number Diff line number Diff line change 6767 run : chmod +x ./source/.github/scripts/deploy-framework
6868
6969 - name : Deploy
70+ env :
71+ PUSH_TOKEN : ${{ secrets.ACCESS_TOKEN }}
7072 run : ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/}
7173
7274 - name : Release
@@ -119,6 +121,8 @@ jobs:
119121 run : chmod +x ./source/.github/scripts/deploy-appstarter
120122
121123 - name : Deploy
124+ env :
125+ PUSH_TOKEN : ${{ secrets.ACCESS_TOKEN }}
122126 run : ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/}
123127
124128 - name : Release
@@ -181,6 +185,8 @@ jobs:
181185 run : chmod +x ./source/.github/scripts/deploy-userguide
182186
183187 - name : Deploy
188+ env :
189+ PUSH_TOKEN : ${{ secrets.ACCESS_TOKEN }}
184190 run : ./source/.github/scripts/deploy-userguide ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/userguide ${GITHUB_REF##*/}
185191
186192 - name : Release
Original file line number Diff line number Diff line change 1919 build :
2020 name : Deploy to gh-pages
2121 permissions :
22- # Allow ad-m/github- push-action to push commit to branch gh-pages
22+ # Allow push to branch gh-pages
2323 contents : write
2424 if : (github.repository == 'codeigniter4/CodeIgniter4')
2525 runs-on : ubuntu-24.04
7777 git commit -m "Update User Guide" -a || true
7878
7979 - name : Push changes
80- uses : ad-m/github-push-action@v1.0.0
81- with :
82- branch : gh-pages
83- directory : gh-pages
84- github_token : ${{ secrets.ACCESS_TOKEN }}
80+ working-directory : gh-pages
81+ env :
82+ PUSH_TOKEN : ${{ secrets.ACCESS_TOKEN }}
83+ run : bash ${GITHUB_WORKSPACE}/.github/scripts/secure-git-push https://github.com/codeigniter4/CodeIgniter4.git HEAD:gh-pages
You can’t perform that action at this time.
0 commit comments