-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add workflow to merge release branch (#256)
Re-usable workflow to be used as a post-release step.
- Loading branch information
1 parent
17908ef
commit 0ab28c7
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
name: Merge release branch into main | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
type: string | ||
description: The release branch version to merge into main | ||
required: true | ||
repo: | ||
type: string | ||
description: The repository to create the PR (org/repo format) | ||
required: true | ||
|
||
workflow_dispatch: | ||
inputs: | ||
version: | ||
type: string | ||
description: The release branch version to merge into main | ||
required: true | ||
repo: | ||
type: string | ||
description: The repository to create the PR (org/repo format) | ||
required: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
merge-release-branch: | ||
name: Submit PR to merge release branch into main | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout ${{ inputs.repo }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.repo }} | ||
ref: release/${{ inputs.version }} | ||
submodules: true | ||
token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
|
||
- name: Create PR | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
commit-message: "chore: merge release/${{ inputs.version }} into main" | ||
committer: eclipse-zenoh-bot <[email protected]> | ||
author: eclipse-zenoh-bot <[email protected]> | ||
base: main | ||
branch: release/${{ inputs.version }} | ||
delete-branch: false | ||
title: 'chore: Merge release/${{ inputs.version }} into main' | ||
body: | | ||
- Merge release/${{ inputs.version }} into main | ||
- Open new development line | ||
labels: internal | ||
|
||
- name: Enable auto merge for the pull request | ||
if: ${{ steps.cpr.outputs.pull-request-operation == 'created' }} | ||
run: > | ||
gh pr merge "${{ steps.cpr.outputs.pull-request-number }}" | ||
--subject "chore: Merge release/${{ inputs.version }} into main (#${{ steps.cpr.outputs.pull-request-number }})" | ||
--repo "${{ inputs.repo }}" | ||
--auto | ||
env: | ||
GH_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }} | ||
|
||
- name: Add the PR as annotation to workflow run | ||
if: ${{ steps.cpr.outputs.pull-request-operation == 'created' }} | ||
run: > | ||
echo "::notice:: Created PR: https://github.com/${{ inputs.repo }}/pull/${{ steps.cpr.outputs.pull-request-number }}" |