mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 03:24:01 +03:00
Set permissions for GitHub actions (#3698)
* 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: naveen <172697+naveensrinivasan@users.noreply.github.com> * Leave comment close to code Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
This commit is contained in:
parent
7c2476d847
commit
e0c04fa0d3
6
.github/workflows/pre-commit-autoupdate.yml
vendored
6
.github/workflows/pre-commit-autoupdate.yml
vendored
|
@ -8,10 +8,16 @@ on:
|
||||||
- cron: "15 2 * * *"
|
- cron: "15 2 * * *"
|
||||||
workflow_dispatch: # to trigger manually
|
workflow_dispatch: # to trigger manually
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-update:
|
auto-update:
|
||||||
# Disables this workflow from running in a repository that is not part of the indicated organization/user
|
# Disables this workflow from running in a repository that is not part of the indicated organization/user
|
||||||
if: github.repository_owner == 'cookiecutter'
|
if: github.repository_owner == 'cookiecutter'
|
||||||
|
permissions:
|
||||||
|
contents: write # for peter-evans/create-pull-request to create branch
|
||||||
|
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
5
.github/workflows/update-contributors.yml
vendored
5
.github/workflows/update-contributors.yml
vendored
|
@ -5,10 +5,15 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Disables this workflow from running in a repository that is not part of the indicated organization/user
|
# Disables this workflow from running in a repository that is not part of the indicated organization/user
|
||||||
if: github.repository_owner == 'cookiecutter'
|
if: github.repository_owner == 'cookiecutter'
|
||||||
|
permissions:
|
||||||
|
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user