Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Apr 21, 2025

Summary

This PR sets the minimum amount of permission needed for each workflow without breaking the existing steps setup.

Reviewers

Testing is happening within this PR and notes left below! 👾

Requirements

@zimeg zimeg added security Use on pull requests related to security semver:patch Use on pull requests to describe the release version increment build M-T: Changes to compilation and CI processes labels Apr 21, 2025
@zimeg zimeg added this to the Next Release milestone Apr 21, 2025
@zimeg zimeg self-assigned this Apr 21, 2025
@codecov
Copy link

codecov bot commented Apr 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.91%. Comparing base (c224bc4) to head (1aad873).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #54   +/-   ##
=======================================
  Coverage   62.91%   62.91%           
=======================================
  Files         210      210           
  Lines       22156    22156           
=======================================
+ Hits        13939    13940    +1     
- Misses       7131     7132    +1     
+ Partials     1086     1084    -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

📝 A few notes while this is in draft, but I hope to test one more thing before considering it reviewtime!

Comment on lines +13 to +14
permissions:
contents: read
Copy link
Member Author

Choose a reason for hiding this comment

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

📣 This is enough to cause the LICENSE checks to fail when needed - 6591d1f causes:

https://github.com/slackapi/slack-cli/actions/runs/14578766377/job/40890636282?pr=54

Comment on lines +20 to +21
permissions:
contents: none
Copy link
Member Author

Choose a reason for hiding this comment

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

📣 Permissions are handled within CircleCI for this workflow:

https://github.com/slackapi/slack-cli/runs/40890474475

Comment on lines +10 to +11
permissions:
contents: none # Permissions are set with an application token
Copy link
Member Author

Choose a reason for hiding this comment

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

📣 The application token is included when needed, and it remains possible to start the job. We might have to wait for an actual update to confirm this though:

https://github.com/slackapi/slack-cli/actions/runs/14578846863/job/40890875279

Copy link
Member Author

Choose a reason for hiding this comment

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

📝 More notes on these permissions are included in the MAINTAINERS_GUIDE.md!

https://github.com/slackapi/slack-cli/blob/main/.github/MAINTAINERS_GUIDE.md#bumping-the-golang-version

Comment on lines +24 to +25
permissions:
contents: write
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +20 to +21
permissions:
contents: read
Copy link
Member Author

Choose a reason for hiding this comment

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

📣 Checking out the repo is all that's required with the default token!

An application token helps with other permissions. Testing after the changes of #52-

Comment on lines +54 to +56
permissions:
checks: write
contents: read
Copy link
Member Author

Choose a reason for hiding this comment

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

📣 AFAICT "contents" is not required for public repos but seems to be a good practice for making this permission clear.

📚 The "checks" permission is required for the health score: https://github.com/slackapi/slack-health-score

@zimeg zimeg marked this pull request as ready for review April 21, 2025 21:38
@zimeg zimeg requested a review from a team as a code owner April 21, 2025 21:38
Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ You're becoming the resident GitHub Action expert @zimeg 😮 🤯 I imagine it took quite a bit of digging to confirm the correct permissions for each of these workflows!

@zimeg
Copy link
Member Author

zimeg commented Apr 22, 2025

@mwbrooks Thanks so much for reviewing once more 🙏

I'm not wanting to admit that some of these permissions have become familiar, but I am glad we can keep track of the actual permissions needed for each job! 🔐 ✨

@zimeg zimeg merged commit b91c571 into main Apr 22, 2025
6 checks passed
@zimeg zimeg deleted the zimeg-ci-permissions branch April 22, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build M-T: Changes to compilation and CI processes security Use on pull requests related to security semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants