feat: open the nightly sync pull request as a github app - #6
Merged
Merged
Conversation
Contributor
octoDNS planThis pull request changes no DNS records. Planned against |
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.
You spotted the problem: PR #4 was authored by you, because
DNS_BOT_TOKENis your personal access token. GitHub does not let anybody approve their own pull request, so on a two person team that left exactly one possible reviewer for every sync PR. Not workable.A GitHub App fixes it. It is the only identity that satisfies all three constraints at once:
GITHUB_TOKENWhat changed
sync-from-cloudflare.ymlmints an installation token withactions/create-github-app-token@v3and uses it for the checkout, the push, and theghcalls. The commit author is set to the App's own bot identity, because the ruleset hasrequire_extra_approval_for_unattributed_changeson and the author has to match whoever pushed.The "no checks will run on this pull request" warning in the PR body is gone. With an App it cannot happen.
Draft until the App exists
Merging this before the App is created breaks the nightly sync, so it stays a draft.
docs/runbook.mdstep 1b has the full walkthrough. Short version:WITCC DNS Bot, webhook off, repository permissionsContents,Pull requests,Issuesall read/write, nothing else.WITCodingClub/dnsonly.gh secret set DNS_BOT_APP_IDandgh secret set DNS_BOT_PRIVATE_KEY --repo WITCodingClub/dns < the.pemDNS_BOT_TOKEN.Note that App creation is browser-only, same as a PAT. I cannot script it.