microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
.github/workflows/merge-release-in-main.yml
44lines · modecode
| 1 | name: Merge release branch back into main |
| 2 | |
| 3 | on: |
| 4 | # Allows you to run this workflow manually from the Actions tab |
| 5 | workflow_dispatch: |
| 6 | push: |
| 7 | branches: |
| 8 | - "release/*" |
| 9 | |
| 10 | concurrency: ${{ github.workflow }}-${{ github.ref }} |
| 11 | |
| 12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 13 | permissions: |
| 14 | id-token: write |
| 15 | contents: write |
| 16 | pull-requests: write |
| 17 | |
| 18 | jobs: |
| 19 | # Create PR |
| 20 | create: |
| 21 | runs-on: ubuntu-latest |
| 22 | steps: |
| 23 | - name: Checkout |
| 24 | uses: actions/checkout@v3 |
| 25 | |
| 26 | - name: Generate branch name |
| 27 | id: branchname |
| 28 | run: | |
| 29 | echo "branchname=backmerge/${{ github.ref_name }}-$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT |
| 30 | - name: Create branch |
| 31 | run: | |
| 32 | branch="${{ steps.branchname.outputs.branchname }}" |
| 33 | git checkout -b $branch |
| 34 | git push --set-upstream origin $branch |
| 35 | |
| 36 | - name: create pull request |
| 37 | id: open-pr |
| 38 | uses: repo-sync/pull-request@v2 |
| 39 | with: |
| 40 | github_token: ${{ secrets.GITHUB_TOKEN }} |
| 41 | source_branch: ${{ steps.branchname.outputs.branchname }} |
| 42 | destination_branch: ${{ github.event.repository.default_branch }} |
| 43 | pr_title: "[Automated] Merge ${{ github.ref_name }} into ${{ github.event.repository.default_branch }}" |
| 44 | pr_body: "Merge ${{github.ref}} back into ${{ github.event.repository.default_branch }}" |
| 45 | |