forked from microsoft/typespec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action to merge release/* branch back into main (microsoft…
- Loading branch information
1 parent
5c837b5
commit 08502ef
Showing
1 changed file
with
44 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,44 @@ | ||
name: Merge release branch back into main | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "release/*" | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
# Create PR | ||
create: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate branch name | ||
id: branchname | ||
run: | | ||
echo "::set-output name=branchname::backmerge/${{ github.ref_name }}-$(date +'%Y-%m-%d')" | ||
- name: Create branch | ||
run: | | ||
branch="${{ steps.branchname.outputs.branchname }}" | ||
git checkout -b $branch | ||
git push --set-upstream origin $branch | ||
- name: create pull request | ||
id: open-pr | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
source_branch: ${{ steps.branchname.outputs.branchname }} | ||
destination_branch: ${{ github.event.repository.default_branch }} | ||
pr_title: "[Automated] Merge ${{ github.ref_name }} into ${{ github.event.repository.default_branch }}" | ||
pr_body: "Merge ${{github.ref}} back into ${{ github.event.repository.default_branch }}" |