Skip to content

Commit cc67446

Browse files
authored
[ci] Update create pull request script in github actions (#11350)
I misunderstood the what the create-pull-request github action does. Its mechanism is to work with branch diff between base and target-branch and squash and push the change to into the target-branch to create a pr against the current working directory. It is designed to auto sync the current work directory with changes from other branches. In our use case, the branch has been prepared through the branch_for_batch_release script, so we don't want the github action to do the squashing and rehash the commit. Instead, we just need to use a simple gh cli to create a pr. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent a3d306f commit cc67446

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

.github/workflows/batch_release_pr.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ jobs:
5656
with:
5757
ref: ${{ env.BRANCH_NAME }}
5858
- name: Create batch release PR
59-
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
60-
with:
61-
token: ${{ secrets.GITHUB_TOKEN }}
62-
commit-message: "[${{ github.event.client_payload.package }}] Batch release"
63-
title: "[${{ github.event.client_payload.package }}] Batch release"
64-
body: "This PR was created automatically to batch release the `${{ github.event.client_payload.package }}`."
65-
branch: ${{ env.BRANCH_NAME }}
66-
base: release-${{ github.event.client_payload.package }}
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: |
62+
gh pr create \
63+
--base "release-${{ github.event.client_payload.package }}" \
64+
--head "${{ env.BRANCH_NAME }}" \
65+
--title "[${{ github.event.client_payload.package }}] Batch release" \
66+
--body "This PR was created automatically to batch release the \`${{ github.event.client_payload.package }}\`."
6767
6868

.github/workflows/sync_release_pr.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1919

2020
- name: Create Pull Request
21-
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
22-
with:
23-
token: ${{ secrets.GITHUB_TOKEN }}
24-
commit-message: "Sync ${{ github.ref_name }} to main"
25-
title: "Sync ${{ github.ref_name }} to main"
26-
body: "This automated PR syncs the changes from the release branch ${{ github.ref_name }} back to the main branch."
27-
branch: ${{ github.ref_name }}
28-
base: main
29-
labels: "post-${{ github.ref_name }}"
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: |
24+
gh pr create \
25+
--base "main" \
26+
--head "${{ github.ref_name }}" \
27+
--title "Sync ${{ github.ref_name }} to main" \
28+
--body "This automated PR syncs the changes from the release branch ${{ github.ref_name }} back to the main branch." \
29+
--label "post-${{ github.ref_name }}"

0 commit comments

Comments
 (0)