From e0aa749b62b08906c069b18112147c6d415f5620 Mon Sep 17 00:00:00 2001 From: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> Date: Wed, 6 Apr 2022 20:35:46 +0000 Subject: [PATCH] Set permissions for GitHub actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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/) 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. Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> --- .github/workflows/ruby.yml | 5 +++++ .github/workflows/stale.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d8a2c7675..f80d3cf49 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -13,6 +13,11 @@ on: pull_request: branches: [ master ] +permissions: + contents: read + jobs: test: + permissions: + contents: none uses: fog/.github/.github/workflows/ruby.yml@v1.1.0 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 95e65f9c1..a1122a2aa 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -4,6 +4,11 @@ on: schedule: - cron: "30 1 * * *" +permissions: + contents: read + jobs: stale: + permissions: + contents: none uses: fog/.github/.github/workflows/stale.yml@v1.1.0