Skip to content

Commit fd23167

Browse files
committed
Limit GITHUB_TOKEN scope for workflows (#1522)
1 parent 8ef49dc commit fd23167

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66

77
jobs:
88
deploy:
9+
permissions:
10+
contents: write
11+
912
runs-on: ubuntu-latest
1013
env:
1114
ruby-version: 2.5

.github/workflows/dev_deploy.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@ on:
55
branches: [ 'dev' ]
66

77
jobs:
8-
deploy:
8+
push_to_registry:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v2
14+
15+
- name: Push to Docker Hub
16+
uses: docker/build-push-action@v1
17+
with:
18+
username: ${{ secrets.DOCKER_USERNAME }}
19+
password: ${{ secrets.DOCKER_ACCESS_KEY }}
20+
repository: slatedocs/slate
21+
tag_with_ref: true
22+
23+
deploy_gh:
24+
permissions:
25+
contents: write
26+
927
runs-on: ubuntu-latest
1028
env:
1129
ruby-version: 2.5
@@ -33,14 +51,6 @@ jobs:
3351
3452
- run: bundle exec middleman build
3553

36-
- name: Push to Docker Hub
37-
uses: docker/build-push-action@v1
38-
with:
39-
username: ${{ secrets.DOCKER_USERNAME }}
40-
password: ${{ secrets.DOCKER_ACCESS_KEY }}
41-
repository: slatedocs/slate
42-
tag_with_ref: true
43-
4454
- name: Deploy
4555
uses: peaceiris/[email protected]
4656
with:

0 commit comments

Comments
 (0)