Skip to content

Commit c0fce6e

Browse files
authored
Update GHA tokens and output (#951) (#952)
1 parent 6e2c10f commit c0fce6e

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

.github/workflows/docs-deploy-surge.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,27 @@ jobs:
4545
- id: get-deploy-id
4646
run: |
4747
deployid=$(<deployid)
48-
echo "::set-output name=deploy-id::$deployid"
48+
case "$deployid" in ''|*[!0-9]*) echo "Provided PR number is not an integer"; exit 1 ;; esac
49+
echo "deploy-id=$deployid" >> "$GITHUB_OUTPUT"
4950
5051
- uses: actions/setup-node@v3
5152
with:
5253
node-version: lts/*
5354

5455
- name: Deploy docs to surge
56+
shell: bash
57+
env:
58+
SURGE_TOKEN: "${{ secrets.DOCS_SURGE_TOKEN }}"
5559
run: |
5660
npm install -g surge
57-
surge ./site ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh --token ${{ secrets.SURGE_TOKEN }}
61+
surge ./site ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh --token "$SURGE_TOKEN"
5862
5963
- name: Comment on PR
6064
uses: marocchino/sticky-pull-request-comment@v2
6165
with:
6266
number: ${{ steps.get-deploy-id.outputs.deploy-id }}
6367
message: |
64-
Looks like you've updated the documentation!
68+
This PR includes documentation updates.
6569
66-
Check out your changes at https://${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh
67-
GITHUB_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }}
70+
You can view the updated docs at https://${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ steps.get-deploy-id.outputs.deploy-id }}.surge.sh
71+
GITHUB_TOKEN: ${{ secrets.DOCS_PR_COMMENT_TOKEN }}

.github/workflows/docs-pr.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ name: "Verify PR"
77
on:
88
pull_request:
99
branches:
10-
- "4.4"
11-
- "5.0"
10+
- "4.[0-9]"
1211
- "5.x"
1312
- "dev"
1413

.github/workflows/docs-teardown.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ name: "Documentation Teardown"
44
on:
55
pull_request_target:
66
branches:
7-
- "4.4"
8-
- "5.0"
7+
- "4.[0-9]"
98
- "5.x"
109
- "dev"
1110
types:
@@ -20,7 +19,19 @@ jobs:
2019
with:
2120
node-version: lts/*
2221
- name: Teardown documentation
22+
shell: bash
23+
env:
24+
SURGE_TOKEN: "${{ secrets.DOCS_SURGE_TOKEN }}"
2325
run: |
2426
npm install -g surge
25-
surge teardown ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ github.event.pull_request.number }}.surge.sh --token ${{ secrets.SURGE_TOKEN }}
26-
27+
surge teardown ${{ github.event.repository.owner.login}}-${{ github.event.repository.name}}-${{ github.event.pull_request.number }}.surge.sh --token "$SURGE_TOKEN"
28+
- name: Comment on PR
29+
uses: marocchino/sticky-pull-request-comment@v2
30+
with:
31+
number: ${{ github.event.pull_request.number }}
32+
message: |
33+
Thanks for the documentation updates.
34+
35+
The preview documentation has now been torn down - reopening this PR will republish it.
36+
GITHUB_TOKEN: ${{ secrets.DOCS_PR_COMMENT_TOKEN }}
37+

0 commit comments

Comments
 (0)