mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 19:21:04 +00:00
chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
This commit is contained in:
parent
5d9b21d757
commit
5deff9583c
5
.github/workflows/no-channel.yml
vendored
5
.github/workflows/no-channel.yml
vendored
|
@ -6,8 +6,13 @@ on:
|
|||
- 'nixos-**'
|
||||
- 'nixpkgs-**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
fail:
|
||||
permissions:
|
||||
contents: none
|
||||
name: "This PR is is targeting a channel branch"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
|
@ -5,8 +5,15 @@ on:
|
|||
- cron: "14 3 * * 1"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
tf-providers:
|
||||
permissions:
|
||||
contents: write # for peter-evans/create-pull-request to create branch
|
||||
issues: write # for peter-evans/create-or-update-comment to create or update comment
|
||||
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
||||
if: github.repository_owner == 'NixOS' && github.ref == 'refs/heads/master' # ensure workflow_dispatch only runs on master
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
Loading…
Reference in a new issue