ci: Add GitHub token permissions for workflows
Signed-off-by: Varun Sharma <varunsh@stepsecurity.io>
This commit is contained in:
parent
1ba4ca5995
commit
2c71278a23
6
.github/workflows/backport.yml
vendored
6
.github/workflows/backport.yml
vendored
@ -8,8 +8,14 @@ on:
|
||||
# the GitHub repository. This means that it should not evaluate user input in a
|
||||
# way that allows code injection.
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
permissions:
|
||||
contents: write # for zeebe-io/backport-action to create branch
|
||||
pull-requests: write # for zeebe-io/backport-action to create PR to backport
|
||||
name: Backport Pull Request
|
||||
if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
|
||||
runs-on: ubuntu-latest
|
||||
|
3
.github/workflows/basic-eval.yml
vendored
3
.github/workflows/basic-eval.yml
vendored
@ -10,6 +10,9 @@ on:
|
||||
# branches:
|
||||
# - master
|
||||
# - release-**
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
5
.github/workflows/direct-push.yml
vendored
5
.github/workflows/direct-push.yml
vendored
@ -4,8 +4,13 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- release-**
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
contents: write # for peter-evans/commit-comment to comment on commit
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'NixOS'
|
||||
env:
|
||||
|
5
.github/workflows/pending-clear.yml
vendored
5
.github/workflows/pending-clear.yml
vendored
@ -4,8 +4,13 @@ on:
|
||||
check_suite:
|
||||
types: [ completed ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
action:
|
||||
permissions:
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: clear pending status
|
||||
|
5
.github/workflows/pending-set.yml
vendored
5
.github/workflows/pending-set.yml
vendored
@ -8,8 +8,13 @@ on:
|
||||
# the GitHub repository. This means that it should not evaluate user input in a
|
||||
# way that allows code injection.
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
action:
|
||||
permissions:
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: set pending status
|
||||
|
6
.github/workflows/periodic-merge-24h.yml
vendored
6
.github/workflows/periodic-merge-24h.yml
vendored
@ -14,8 +14,14 @@ on:
|
||||
# Merge every 24 hours
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
periodic-merge:
|
||||
permissions:
|
||||
contents: write # for devmasx/merge-branch to merge branches
|
||||
issues: write # for peter-evans/create-or-update-comment to create or update comment
|
||||
if: github.repository_owner == 'NixOS'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
|
6
.github/workflows/periodic-merge-6h.yml
vendored
6
.github/workflows/periodic-merge-6h.yml
vendored
@ -14,8 +14,14 @@ on:
|
||||
# Merge every 6 hours
|
||||
- cron: '0 */6 * * *'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
periodic-merge:
|
||||
permissions:
|
||||
contents: write # for devmasx/merge-branch to merge branches
|
||||
issues: write # for peter-evans/create-or-update-comment to create or update comment
|
||||
if: github.repository_owner == 'NixOS'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
|
Loading…
Reference in New Issue
Block a user