You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/06/21 13:44:08 UTC
[incubator-nuttx-apps] 04/05: chore: Set permissions for GitHub actions
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit 83ea328ef540f66fbe87a1989a95499ea906b362
Author: naveen <17...@users.noreply.github.com>
AuthorDate: Fri Jun 17 00:32:28 2022 +0000
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 <17...@users.noreply.github.com>
---
.github/workflows/build.yml | 2 ++
.github/workflows/check.yml | 3 +++
.github/workflows/lint.yml | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7775dcbf9..767afe28b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -155,6 +155,8 @@ jobs:
continue-on-error: true
macOS:
+ permissions:
+ contents: none
runs-on: macos-10.15
needs: Fetch-Source
strategy:
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index ccca43d27..da7ca7dd9 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -19,6 +19,9 @@ concurrency:
group: check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
+permissions:
+ contents: read
+
jobs:
check:
runs-on: ubuntu-18.04
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index df35b1b7f..58c6007d2 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -6,8 +6,14 @@ concurrency:
group: lint-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
+permissions:
+ contents: read
+
jobs:
lint:
+ permissions:
+ contents: read # for actions/checkout to fetch code
+ statuses: write # for github/super-linter to mark status of each linter run
name: Lint
runs-on: ubuntu-latest
steps: