-
Notifications
You must be signed in to change notification settings - Fork 185
ci: change automated docs update to use PRs #868
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
Conversation
Deploying electron-website with
|
Latest commit: |
d56b4e1
|
Status: | ✅ Deploy successful! |
Preview URL: | https://9d229e91.electron-website.pages.dev |
Branch Preview URL: | https://ci-automated-update-pr.electron-website.pages.dev |
c9201ff
to
ecd4f54
Compare
.github/workflows/update-docs.yml
Outdated
run: | | ||
PR_NUMBER=$(gh pr list --head "docs/update-to-${SHA}" --json number --jq '.[0].number') | ||
gh pr review ${PR_NUMBER} --approve | ||
gh pr merge ${PR_NUMBER} --auto --squash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a "wait for checks" step here that waits up to ~20 minutes for required CI to pass?
More ideally it would fire a separate job once PR enters "mergable" state. But for now whack a while !status_passed
kinda loop for fun will get us unblocked I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the --auto
flag should handle this for us? From the gh
CLI docs: "Automatically merge only after necessary requirements are met".
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr review "docs/update-to-${SHA}" --approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naive question: would this be a self-approve and then not count for the purposes of mergeability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a subtle difference here (which I could call out better in the code with a comment), but we're using secrets.GITHUB_TOKEN
here so it'll be the default GitHub Actions app approving the PR, which was opened by our GitHub app.
Description of Change
We have some required status checks now which require a PR, and that's breaking our existing automation solution of pushing straight to
main
. Run everything through a PR which the existing GitHub app will create, and then use the generic GitHub Actions app to approve and merge the PR.Checklist