Repository navigation
ci(collect): open collection PRs as TechEngineBot - #391
Merged
Merged
Conversation
The maintainer's account still pushes the task's collect/* branch, but TechEngineBot now opens the PR, or updates the open one. Its gh login is kept in its own config directory, ~/.config/gh-techenginebot by default, so the maintainer's own login is never used for the PR or changed. The script checks that login before it pushes anything, and ignores GH_TOKEN and GITHUB_TOKEN for it, so a token in the environment can't open the PR as another account. No workflow opens PRs: collect.yml's token stays read-only. Refs #297
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TechEngineBot now opens collection PRs instead of the maintainer's account. The maintainer still runs
open-collect-pr.shby hand, and their account still pushes the task'scollect/*branch. Only thegh pr create,gh pr editandgh pr readycalls run as TechEngineBot.~/.config/gh-techenginebot, orTECHENGINEBOT_GH_CONFIG_DIRif set. The maintainer's own gh login is never used for the PR, and never changed.GH_TOKENandGITHUB_TOKEN, so a token in the environment can't open the PR as another account.README.mdand the header ofcollect.ymlnow say the same.Why
PRs are now opened by TechEngineBot, never by a workflow:
collect.yml's token stays read-only.So no workflow can open or approve a PR.
TechAPI's Actions policy now also lets TechEngineBot trigger workflows, so pr-checks runs on the PRs it opens. TechEngineBot opened this PR itself.
Checks
bash -npasses.GH_TOKENholds another account's token.gh api userunder that config answers TechEngineBot, and the maintainer's own gh login is unchanged.Closes #297