Skip to content

Commit

Permalink
chore: Set permissions for GitHub actions (#2442)
Browse files Browse the repository at this point in the history
- 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: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
  • Loading branch information
neilnaveen committed Apr 14, 2022
1 parent 0b334a5 commit 801be0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -14,8 +14,15 @@ on:
schedule:
- cron: '0 9 * * 3'

permissions:
contents: read

jobs:
analyze:
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
name: Analyze
runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Expand Up @@ -68,6 +68,8 @@ jobs:
run: npx semantic-release

Skip:
permissions:
contents: none
if: contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
Expand Down

2 comments on commit 801be0e

@vercel
Copy link

@vercel vercel bot commented on 801be0e Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 801be0e Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

markedjs – ./

markedjs-git-master-markedjs-legacy.vercel.app
markedjs-markedjs-legacy.vercel.app

Please sign in to comment.