Skip to content

Commit bf994ce

Browse files
committed
Use managed PAT for bundle preview and release builds [no-release]
1 parent ed28d4e commit bf994ce

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

.github/workflows/deploy-bundle-preview.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Configure Git Credentials
17-
uses: de-vri-es/setup-git-credentials@v2
18-
with:
19-
credentials: ${{ secrets.GIT_CREDENTIALS }}
20-
2116
- name: Checkout Repository
2217
uses: actions/checkout@v4
2318

@@ -56,7 +51,7 @@ jobs:
5651
if: ${{ success() && github.event.pull_request.number }}
5752
uses: peter-evans/create-or-update-comment@v3
5853
with:
59-
token: ${{ secrets.COMMENT_GITHUB_TOKEN }}
54+
token: ${{ secrets.DOCS_GITHUB_PAT }}
6055
issue-number: ${{ github.event.pull_request.number }}
6156
body: |
6257
UI bundle preview build successful! :white_check_mark:
@@ -67,7 +62,7 @@ jobs:
6762
if: ${{ failure() && github.event.pull_request.number }}
6863
uses: peter-evans/create-or-update-comment@v3
6964
with:
70-
token: ${{ secrets.COMMENT_GITHUB_TOKEN }}
65+
token: ${{ secrets.DOCS_GITHUB_PAT }}
7166
issue-number: ${{ github.event.pull_request.number }}
7267
body: |
7368
UI bundle preview build failure! :x:
@@ -79,16 +74,15 @@ jobs:
7974
uses: peter-evans/find-comment@v2
8075
id: fc
8176
with:
82-
token: ${{ secrets.COMMENT_GITHUB_TOKEN }}
77+
token: ${{ secrets.DOCS_GITHUB_PAT }}
8378
issue-number: ${{ github.event.pull_request.number }}
84-
comment-author: 'mlr'
8579
body-includes: UI bundle preview build successful!
8680
direction: last
8781

8882
- name: Deploy to GitHub Pages
8983
if: success()
9084
run: |
91-
git clone https://github.com/$GITHUB_REPOSITORY.git pages
85+
git clone git@github.com:$GITHUB_REPOSITORY.git pages
9286
cd pages
9387
git checkout gh-pages
9488
@@ -116,7 +110,7 @@ jobs:
116110
sleep 5 # Allow time for build to initiate
117111
build_url=$(curl -s -L \
118112
-H "Accept: application/vnd.github+json" \
119-
-H "Authorization: Bearer ${{ secrets.COMMENT_GITHUB_TOKEN }}" \
113+
-H "Authorization: Bearer ${{ secrets.DOCS_GITHUB_PAT }}" \
120114
-H "X-GitHub-Api-Version: 2022-11-28" 'https://api.github.com/repos/${{ github.event.repository.full_name }}/pages/builds/latest' \
121115
| jq -r .url)
122116
echo "url=$build_url" >> $GITHUB_OUTPUT
@@ -128,7 +122,7 @@ jobs:
128122
for i in {1..60}; do
129123
build_status=$(curl -s -L \
130124
-H "Accept: application/vnd.github+json" \
131-
-H "Authorization: Bearer ${{ secrets.COMMENT_GITHUB_TOKEN }}" \
125+
-H "Authorization: Bearer ${{ secrets.DOCS_GITHUB_PAT }}" \
132126
-H "X-GitHub-Api-Version: 2022-11-28" '${{ steps.ghpages_build.outputs.url }}' \
133127
| jq -r .status)
134128
@@ -153,7 +147,7 @@ jobs:
153147
if: ${{ steps.fc.outputs.comment-id != '' }}
154148
uses: peter-evans/create-or-update-comment@v3
155149
with:
156-
token: ${{ secrets.COMMENT_GITHUB_TOKEN }}
150+
token: ${{ secrets.DOCS_GITHUB_PAT }}
157151
comment-id: ${{ steps.fc.outputs.comment-id }}
158152
body: |
159153
Deployment successful! [View preview](${{ steps.draft_url.outputs.url }})

.github/workflows/release-ui-bundle.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Configure Git Credentials
1717
uses: de-vri-es/setup-git-credentials@v2
1818
with:
19-
credentials: ${{ secrets.GIT_CREDENTIALS }}
19+
credentials: https://${{ secrets.DOCS_GITHUB_PAT }}@github.com
2020

2121
- name: Checkout Repository
2222
uses: actions/checkout@v4
@@ -25,8 +25,6 @@ jobs:
2525

2626
- name: Check Last Commit Message
2727
id: skip_release
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3028
run: |
3129
last_commit_message=$(git log -1 --pretty=%B)
3230
if [[ $last_commit_message == *"[no-release]"* ]]; then

0 commit comments

Comments
 (0)