forked from Azure/typespec-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.56 KB
/
merge-release-in-main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 --force
# ---
# Unfortunately, this step is no longer possible due to security constraints.
# User will have to create the PR manually until we can get a way to create a PR here.
# ---
#- 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 }}"