Skip to content

Update merge-main-into-feature-branch script #1420

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/update-feature-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ env:
defaultBranchPattern: "feature_branch/*"
defaultMainBranch: "main"
triggerTestsLabel: "tests-requested: quick"
branchPrefix: "workflow/auto-merge-feature-branch-"


jobs:
list_feature_branches:
Expand Down Expand Up @@ -85,6 +87,11 @@ jobs:
python scripts/gha/install_prereqs_desktop.py
python -m pip install requests

- name: Name new branch
run: |
date_str=$(date "+%Y%m%d-%H%M%S")
echo "NEW_BRANCH=${{env.branchPrefix}}${{github.run_number}}-${date_str}" >> $GITHUB_ENV

- name: Create merge PR
id: create-pr
run: |
Expand Down Expand Up @@ -115,7 +122,10 @@ jobs:

> Created on ${date_str} by [${{github.workflow}} workflow]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID).
"
pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${main_branch}" --title "${pr_title}" --body "${pr_body}")
git checkout main
git checkout -b "${NEW_BRANCH}"
git push --set-upstream origin "${NEW_BRANCH}"
pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${NEW_BRANCH}" --title "${pr_title}" --body "${pr_body}")
echo "created_pr_number=${pr_number}" >> $GITHUB_OUTPUT

- name: Set test trigger label.
Expand Down