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

Update required checks: Allow authenticating via the GitHub CLI #1138

Merged
merged 5 commits into from Jul 12, 2022

Conversation

henrymercer
Copy link
Contributor

We no longer run this script within Actions for security reasons, and when running locally we can authenticate with the GitHub CLI instead of a PAT.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@henrymercer henrymercer requested a review from a team as a code owner July 12, 2022 16:08
@adityasharad
Copy link
Contributor

Maybe still keep a log warning, and a comment that this script is meant for interactive use, not as an unattended script. Otherwise in an unattended setting it will hang when it waits for you to authenticate.

Avoid trying to evaluate `github/codeql-action`.
We no longer run this script within Actions for security reasons, and
when running locally we can authenticate with the GitHub CLI instead
of a PAT.
@henrymercer
Copy link
Contributor Author

henrymercer commented Jul 12, 2022

I don't really like the idea of logging warnings when everything's fine, particularly when the main use case of this script is running from a dev machine. However I can see the benefit in preventing an unattended script from hanging. I've switched to checking gh auth status at the start of the script instead. This returns a non-zero exit code if the user isn't authed.

Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Forgot to leave this comment earlier.

.github/workflows/script/update-required-checks.sh Outdated Show resolved Hide resolved
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
@henrymercer henrymercer merged commit d750c6d into main Jul 12, 2022
@henrymercer henrymercer deleted the henrymercer/drop-token-check branch July 12, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants