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

[GHA] Specify permissions when deviating from defaults #2721

Closed
wants to merge 1 commit into from

Conversation

CristianLara
Copy link
Contributor

Motivation

The publish_website.yml workflow requires write permissions to

  1. create new docusaurus versions by pushing a commit to docusaurus-versions branch
  2. push new website to gh-pages

This was not an issue in the fork that introduced these changes because Meta's organization / the official repo has more restrictive permissions than the defaults. More restrictive default permissions are definitely the way to go, here we elevate permissions only when necessary.

Test Plan

I made the default permissions in my fork more restrictive such that the same workflows would fail then verified that this change results in successful workflow runs. https://github.com/CristianLara/botorch/actions/runs/13107635487/job/36565023833

The publish_website.yml workflow requires write permissions to
1. create new docusaurus versions by pushing a commit to `docusaurus-versions` branch
2. push new website to gh-pages
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 3, 2025
@facebook-github-bot
Copy link
Contributor

@CristianLara has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.99%. Comparing base (8814f68) to head (b3d07f1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2721   +/-   ##
=======================================
  Coverage   99.98%   99.99%           
=======================================
  Files         203      203           
  Lines       18671    18671           
=======================================
+ Hits        18669    18670    +1     
+ Misses          2        1    -1     

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

Copy link
Contributor

@saitcakmak saitcakmak left a comment

Choose a reason for hiding this comment

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

Lgtm. AFAIK, the publish_website doesn't rely on secrets anymore (previously, docusaurus bot needed it, I think), so removing those also seems safe there.

@facebook-github-bot
Copy link
Contributor

@CristianLara merged this pull request in 37f3f7d.

facebook-github-bot pushed a commit to facebook/Ax that referenced this pull request Feb 3, 2025
Summary:
## Context

Duplicate of change made in botorch: pytorch/botorch#2721

## Motivation

The `publish_website.yml` workflow requires write permissions to
1. create new docusaurus versions by pushing a commit to `docusaurus-versions` branch
2. push new website to gh-pages

This was not an issue in the fork that introduced these changes because Meta's organization / the official repo has more restrictive permissions than the defaults. More restrictive default permissions are definitely the way to go, here we elevate permissions only when necessary.

Pull Request resolved: #3299

Test Plan: I made the default permissions in my fork more restrictive such that the same workflows would fail then verified that this change results in successful workflow runs. https://github.com/CristianLara/botorch/actions/runs/13107635487/job/36565023833

Reviewed By: Balandat

Differential Revision: D69035808

Pulled By: CristianLara

fbshipit-source-id: 1f663e79609ae1e7318d9be9b9b3bb16eee3e835
@saitcakmak saitcakmak deleted the gha-specify-permissions branch February 3, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants