Skip to content

Conversation

@kurmiashish
Copy link
Contributor

Description

This PR adds minimum token permissions for the GITHUB_TOKEN in GitHub Actions workflows using https://github.com/step-security/secure-workflows.

The GitHub Actions workflow has a GITHUB_TOKEN with write access to multiple scopes.
Here is an example of the permissions in one of the workflow runs:
https://github.com/GoogleForCreators/web-stories-wp/runs/8188010407?check_suite_focus=true#step:1:19

After this change, the scopes will be reduced to the minimum needed for the following workflow:

  • update-templates.yml

The following workflow files already have the least privileged token permission set:

  • add-milestone.yml
  • codeql-analysis.yml
  • lint-i18n.yml
  • plugin-release.yml
  • tests-karma-dashboard.yml
  • tests-unit-php.yml
  • update-product-schema.yml
  • build-and-deploy.yml
  • deploy-storybook.yml
  • lint-php.yml
  • scorecards.yml
  • tests-karma-editor.yml
  • update-browserslist.yml
  • cleanup-pr-assets.yml
  • lint-css-js-md.yml
  • npm-release.yml
  • tests-e2e.yml
  • tests-unit-js.yml
  • update-google-fonts.yml

Motivation and Context

Signed-off-by: Ashish Kurmi akurmi@stepsecurity.io

@google-cla
Copy link

google-cla bot commented Sep 11, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Signed-off-by: Ashish Kurmi <kurmiashish@gmail.com>
@swissspidy swissspidy changed the title ci: add minimum GitHub token permissions for workflow CI: Update GitHub token permissions for templates workflow Sep 11, 2022
@swissspidy swissspidy merged commit f2cf9b8 into GoogleForCreators:main Sep 11, 2022
@swissspidy swissspidy added the Type: Infrastructure Changes impacting testing infrastructure or build tooling label Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Infrastructure Changes impacting testing infrastructure or build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants