16
16
- name : Configure Git Credentials
17
17
uses : de-vri-es/setup-git-credentials@v2
18
18
with :
19
- credentials : ${{ secrets.GIT_CREDENTIALS }}
19
+ credentials : https:// ${{ secrets.DOCS_GITHUB_PAT }}@github.com
20
20
21
21
- name : Checkout Repository
22
22
uses : actions/checkout@v4
56
56
if : ${{ success() && github.event.pull_request.number }}
57
57
uses : peter-evans/create-or-update-comment@v3
58
58
with :
59
- token : ${{ secrets.COMMENT_GITHUB_TOKEN }}
59
+ token : ${{ secrets.DOCS_GITHUB_PAT }}
60
60
issue-number : ${{ github.event.pull_request.number }}
61
61
body : |
62
62
UI bundle preview build successful! :white_check_mark:
67
67
if : ${{ failure() && github.event.pull_request.number }}
68
68
uses : peter-evans/create-or-update-comment@v3
69
69
with :
70
- token : ${{ secrets.COMMENT_GITHUB_TOKEN }}
70
+ token : ${{ secrets.DOCS_GITHUB_PAT }}
71
71
issue-number : ${{ github.event.pull_request.number }}
72
72
body : |
73
73
UI bundle preview build failure! :x:
@@ -79,15 +79,17 @@ jobs:
79
79
uses : peter-evans/find-comment@v2
80
80
id : fc
81
81
with :
82
- token : ${{ secrets.COMMENT_GITHUB_TOKEN }}
82
+ token : ${{ secrets.DOCS_GITHUB_PAT }}
83
83
issue-number : ${{ github.event.pull_request.number }}
84
- comment-author : ' mlr'
85
84
body-includes : UI bundle preview build successful!
86
85
direction : last
87
86
88
87
- name : Deploy to GitHub Pages
89
88
if : success()
90
89
run : |
90
+ # Configure git to use the PAT for cloning and pushing to the gh-pages branch
91
+ git config --global url.https://${{ secrets.DOCS_GITHUB_PAT }}@github.com/.insteadOf https://github.com/
92
+
91
93
git clone https://github.com/$GITHUB_REPOSITORY.git pages
92
94
cd pages
93
95
git checkout gh-pages
@@ -116,7 +118,7 @@ jobs:
116
118
sleep 5 # Allow time for build to initiate
117
119
build_url=$(curl -s -L \
118
120
-H "Accept: application/vnd.github+json" \
119
- -H "Authorization: Bearer ${{ secrets.COMMENT_GITHUB_TOKEN }}" \
121
+ -H "Authorization: Bearer ${{ secrets.DOCS_GITHUB_PAT }}" \
120
122
-H "X-GitHub-Api-Version: 2022-11-28" 'https://api.github.com/repos/${{ github.event.repository.full_name }}/pages/builds/latest' \
121
123
| jq -r .url)
122
124
echo "url=$build_url" >> $GITHUB_OUTPUT
@@ -128,7 +130,7 @@ jobs:
128
130
for i in {1..60}; do
129
131
build_status=$(curl -s -L \
130
132
-H "Accept: application/vnd.github+json" \
131
- -H "Authorization: Bearer ${{ secrets.COMMENT_GITHUB_TOKEN }}" \
133
+ -H "Authorization: Bearer ${{ secrets.DOCS_GITHUB_PAT }}" \
132
134
-H "X-GitHub-Api-Version: 2022-11-28" '${{ steps.ghpages_build.outputs.url }}' \
133
135
| jq -r .status)
134
136
@@ -153,7 +155,7 @@ jobs:
153
155
if : ${{ steps.fc.outputs.comment-id != '' }}
154
156
uses : peter-evans/create-or-update-comment@v3
155
157
with :
156
- token : ${{ secrets.COMMENT_GITHUB_TOKEN }}
158
+ token : ${{ secrets.DOCS_GITHUB_PAT }}
157
159
comment-id : ${{ steps.fc.outputs.comment-id }}
158
160
body : |
159
161
Deployment successful! [View preview](${{ steps.draft_url.outputs.url }})
0 commit comments