Skip to content

Conversation

dsanders11
Copy link
Member

@dsanders11 dsanders11 commented Sep 17, 2025

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

  • This PR was not created with AI. (PRs created mainly with AI will be closed. They waste our team's time. We ban repeat offenders.)

@dsanders11 dsanders11 requested a review from a team as a code owner September 17, 2025 01:38
Copy link

cloudflare-workers-and-pages bot commented Sep 17, 2025

Deploying electron-website with  Cloudflare Pages  Cloudflare Pages

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

View logs

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
Copy link
Member

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

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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.

@dsanders11 dsanders11 merged commit c4fa1c5 into main Sep 17, 2025
5 checks passed
@dsanders11 dsanders11 deleted the ci/automated-update-pr branch September 17, 2025 18:32
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.

3 participants