Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Restrict content permissions to harden GitHub Actions #2484

Merged
merged 4 commits into from
May 25, 2024

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented May 25, 2024

Description

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Restrict content permissions to read. At the moment there are no
  steps to the changed workflows that use tokens, and so this is
  preventative if this ever changes.
* Give packages write permissions to publish to ghcr.
   - Amends PR https://github.com/scikit-hep/pyhf/pull/2483.

* Restrict content permissions to read. At the moment there are no
  steps to the changed workflows that use tokens, and so this is
  perventative if this ever changes.
* Extends PR 2483.
@matthewfeickert matthewfeickert added CI CI systems, GitHub Actions security Improving repository security measures labels May 25, 2024
@matthewfeickert matthewfeickert self-assigned this May 25, 2024
Copy link

codecov bot commented May 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.21%. Comparing base (cdd404a) to head (2c7cd3f).
Report is 22 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2484   +/-   ##
=======================================
  Coverage   98.21%   98.21%           
=======================================
  Files          69       69           
  Lines        4543     4543           
  Branches      804      804           
=======================================
  Hits         4462     4462           
  Misses         48       48           
  Partials       33       33           
Flag Coverage Δ
contrib 97.79% <ø> (ø)
doctest 98.08% <ø> (ø)
unittests-3.10 96.23% <ø> (ø)
unittests-3.11 96.23% <ø> (ø)
unittests-3.12 96.23% <ø> (ø)
unittests-3.8 96.25% <ø> (ø)
unittests-3.9 96.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matthewfeickert
Copy link
Member Author

matthewfeickert commented May 25, 2024

Need to give packages write permissions as PR #2483 failed on pushing to the registry with

ERROR: failed to solve: failed to push ghcr.io/scikit-hep/pyhf:latest: unexpected status from POST request to https://ghcr.io/v2/scikit-hep/pyhf/blobs/uploads/: 403 Forbidden

and https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-actions shows that requires write to POST.

@matthewfeickert matthewfeickert merged commit 42cd129 into main May 25, 2024
23 checks passed
@matthewfeickert matthewfeickert deleted the ci/restrict-token-permissions branch May 25, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI systems, GitHub Actions security Improving repository security measures
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant