Skip to content

Conversation

@alocay
Copy link
Contributor

@alocay alocay commented Aug 25, 2025

Adding a github workflow to auto-generate a sync PR to merge main into develop.

  • Triggers on PR being merged into main.
  • Creates a sync branch to merge changes from main into develop (not a rebase).
  • Adds a comment to the original merged PR with a link to this sync PR.
  • Added a workflow dispatch trigger for manual testing on branches other than main and develop.

@alocay alocay requested a review from a team as a code owner August 25, 2025 15:29
@apollo-librarian
Copy link

apollo-librarian bot commented Aug 25, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: ca7e2e5bad4d2fcee5312ccf
Build Logs: View logs

@alocay alocay changed the title Gt 367 GitHub workflow sync main pr Gt 367 GitHub workflow to merge main into develop Aug 25, 2025
Copy link
Contributor

@swcollard swcollard left a comment

Choose a reason for hiding this comment

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

This all looks reasonable to me! Inputs line up with the create pr action, https://github.com/marketplace/actions/create-pull-request

Comment on lines +4 to +6
pull_request:
types: [closed]
branches: [main]
Copy link
Contributor

Choose a reason for hiding this comment

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

A pull request to main happens when we have a release, correct?

Can we make sure that the settings for this package is set up to where you can only merge to main from pull requests? So folks can't push to main directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe main already has this branch protection rule in place by default but we can double check.

uses: peter-evans/create-pull-request@v6
with:
branch: ${{ steps.meta.outputs.branch }}
base: ${{ env.BASE_BRANCH }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little confused why in this case it uses env.BASE_BRANCH when above it just references it as BASE_BRANCH?

I am guessing it's because above that is in a bash script and not just yml templating so the syntax is different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the run portion above runs as a bash script so we just reference it as ${BASE_BRANCH} but this portion doesn't run as a bash script and instead needs it as a GitHub action expression. Hence the two different formats.

@alocay alocay merged commit cc7b99a into develop Aug 25, 2025
7 checks passed
alocay added a commit that referenced this pull request Aug 25, 2025
* ci: adding a workflow to autogen main to develop sync pr

* ci: adding a work dispatch trigger for testing

* chore: adjusting bool check for consistency
alocay added a commit that referenced this pull request Aug 25, 2025
* ci: adding a workflow to autogen main to develop sync pr

* ci: adding a work dispatch trigger for testing

* chore: adjusting bool check for consistency
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