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
|
||||
jobs:
|
||||
get-build-and-deploy:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
if: >
|
||||
${{ 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:
|
||||
name: 'Deploy'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
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:
|
||||
name: 'Deploy to Netlify'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3.0.2
|
||||
|
@ -53,6 +55,8 @@ jobs:
|
|||
push_to_dockerhub:
|
||||
name: Push Docker image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3.0.2
|
||||
|
|
Loading…
Reference in a new issue