Skip to content

Commit 1771858

Browse files
authored
chore: use built-in github token to improve security (#758)
1 parent 7c70b9e commit 1771858

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: CI/CD
22
on: [push, pull_request]
3+
permissions:
4+
contents: read
35
jobs:
46
build:
57
runs-on: ubuntu-latest
@@ -86,9 +88,11 @@ jobs:
8688

8789
release:
8890
runs-on: ubuntu-latest
89-
env:
90-
GH_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
91-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
91+
permissions:
92+
issues: write
93+
contents: write
94+
pull-requests: write
95+
deployments: write
9296
needs: [build, test]
9397
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
9498
steps:
@@ -110,3 +114,6 @@ jobs:
110114

111115
- name: Release
112116
run: yarn semantic-release
117+
env:
118+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)