You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -30,13 +30,14 @@ on: [pull_request]
30
30
jobs:
31
31
preview:
32
32
runs-on: ubuntu-latest
33
+
permissions:
34
+
pull-requests: write # allow surge-preview to create/update PR comments
33
35
steps:
34
36
- uses: actions/checkout@v2
35
37
- uses: afc163/surge-preview@v1
36
38
id: preview_step
37
39
with:
38
40
surge_token: ${{ secrets.SURGE_TOKEN }}
39
-
github_token: ${{ secrets.GITHUB_TOKEN }}
40
41
dist: public
41
42
build: |
42
43
npm install
@@ -54,6 +55,9 @@ name: 🔂 Surge PR Preview
54
55
55
56
on: [pull_request]
56
57
58
+
permissions:
59
+
pull-requests: write # allow surge-preview to create/update PR comments
60
+
57
61
jobs:
58
62
preview-job-1:
59
63
runs-on: ubuntu-latest
@@ -62,7 +66,6 @@ jobs:
62
66
- uses: afc163/surge-preview@v1
63
67
with:
64
68
surge_token: ${{ secrets.SURGE_TOKEN }}
65
-
github_token: ${{ secrets.GITHUB_TOKEN }}
66
69
dist: public
67
70
build: |
68
71
npm install
@@ -74,7 +77,6 @@ jobs:
74
77
- uses: afc163/surge-preview@v1
75
78
with:
76
79
surge_token: ${{ secrets.SURGE_TOKEN }}
77
-
github_token: ${{ secrets.GITHUB_TOKEN }}
78
80
dist: public
79
81
build: |
80
82
npm install
@@ -102,12 +104,13 @@ on:
102
104
jobs:
103
105
preview:
104
106
runs-on: ubuntu-latest
107
+
permissions:
108
+
pull-requests: write # allow surge-preview to create/update PR comments
105
109
steps:
106
110
- uses: actions/checkout@v2
107
111
- uses: afc163/surge-preview@v1
108
112
with:
109
113
surge_token: ${{ secrets.SURGE_TOKEN }}
110
-
github_token: ${{ secrets.GITHUB_TOKEN }}
111
114
dist: public
112
115
teardown: 'true'
113
116
build: |
@@ -118,7 +121,7 @@ jobs:
118
121
### Inputs
119
122
120
123
- `surge_token`: [Getting your Surge token](https://surge.sh/help/integrating-with-circleci).
121
-
- `github_token`: `secrets.GITHUB_TOKEN`.
124
+
- `github_token`: Defaults: [`github.token`](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow). It is used to create Pull Request comment, so it requires the `pull-requests` permission set to `write` permission. Possible value: `secrets.GITHUB_TOKEN`.
122
125
- `build`: build scripts to run before deploy.
123
126
- `dist`: dist folder deployed to [surge.sh](https://surge.sh/).
124
127
- `failOnError`: Set `failed` if a deployment throws error, defaults to `false`.
0 commit comments