Reduce GITHUB_TOKEN perms in actions when using 3rd party scripts
This avoids allowing third parties to arbitrarily overwrite the repository.
This commit is contained in:
parent
e5b3eeebd9
commit
8fd3497015
3 changed files with 9 additions and 1 deletions
3
.github/workflows/deploy-pull-request.yml
vendored
3
.github/workflows/deploy-pull-request.yml
vendored
|
@ -6,6 +6,9 @@ on:
|
||||||
- completed
|
- completed
|
||||||
jobs:
|
jobs:
|
||||||
get-build-and-deploy:
|
get-build-and-deploy:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >
|
if: >
|
||||||
${{ github.event.workflow_run.conclusion == 'success' }}
|
${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
|
3
.github/workflows/netlify-dev.yml
vendored
3
.github/workflows/netlify-dev.yml
vendored
|
@ -9,7 +9,8 @@ jobs:
|
||||||
deploy-to-netlify:
|
deploy-to-netlify:
|
||||||
name: 'Deploy'
|
name: 'Deploy'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
|
|
4
.github/workflows/prod-deploy.yml
vendored
4
.github/workflows/prod-deploy.yml
vendored
|
@ -37,6 +37,8 @@ jobs:
|
||||||
deploy-to-netlify:
|
deploy-to-netlify:
|
||||||
name: 'Deploy to Netlify'
|
name: 'Deploy to Netlify'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
|
@ -53,6 +55,8 @@ jobs:
|
||||||
push_to_dockerhub:
|
push_to_dockerhub:
|
||||||
name: Push Docker image to Docker Hub
|
name: Push Docker image to Docker Hub
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3.0.2
|
uses: actions/checkout@v3.0.2
|
||||||
|
|
Loading…
Reference in a new issue