Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
use a PAT to allow automatic action trigger on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoester committed Aug 30, 2023
1 parent fb0c878 commit 1b54856
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/PR-into-2021-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
merge-and-PR-into-2021-1:
# only trigger if it was actually merged
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
steps:

Expand All @@ -21,25 +21,26 @@ jobs:
with:
ref: 'mps/2021.1'
fetch-depth: 0

# actually merge from the previous branch
- name: Perform merge from 2020.3 to 2021.1
run: |
# setup to allow to merge and commit
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# actual merge operation
git merge --no-ff --message "Merge 2020.3 -> 2021.1" origin/mps/2020.3 -- || ( echo "Merge failed. Please merge manually!" ; exit 1 )
# create a PR based on the merge
- name: Create PR for MPS 2021.1
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MPS_REPO_PAT }}
branch: 'merge/2021.1'
commit-message: Merge mps/2020.3 into mps/2021.1
title: ${{ github.event.pull_request.title }} (2020.3 -> 2021.1)
body: |
This is an automatic PR which merges changes from `mps/2020.3` to `mps/2021.1`.
[Link to previous PR for `mps/2020.3`](${{ github.event.pull_request._links.html.href }})
11 changes: 6 additions & 5 deletions .github/workflows/PR-into-2021-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
merge-and-PR-into-2021-2:
# only trigger if it was actually merged
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
steps:

Expand All @@ -21,14 +21,14 @@ jobs:
with:
ref: 'mps/2021.2'
fetch-depth: 0

# actually merge from the previous branch
- name: Perform merge from 2021.1 to 2021.2
run: |
# setup to allow to merge and commit
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# actual merge operation
git merge --no-ff --message "Merge 2021.1 -> 2021.2" origin/mps/2021.1 -- || ( echo "Merge failed. Please merge manually!" ; exit 1 )
Expand All @@ -39,15 +39,16 @@ jobs:
NEW_TITLE='${{ github.event.pull_request.title }}'
NEW_TITLE="${NEW_TITLE// (2020.3 -> 2021.1)}"
echo "NEW_TITLE=$NEW_TITLE" >> $GITHUB_ENV
# create a PR based on the merge
- name: Create PR for MPS 2021.2
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MPS_REPO_PAT }}
branch: 'merge/2021.2'
commit-message: Merge mps/2021.1 into mps/2021.2
title: ${{ env.NEW_TITLE }} (2021.1 -> 2021.2)
body: |
This is an automatic PR which merges changes from `mps/2021.1` to `mps/2021.2`.
[Link to previous PR for `mps/2021.1`](${{ github.event.pull_request._links.html.href }})
9 changes: 5 additions & 4 deletions .github/workflows/PR-into-2021-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
merge-and-PR-into-2021-3:
# only trigger if it was actually merged
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
steps:

Expand All @@ -21,14 +21,14 @@ jobs:
with:
ref: 'mps/2021.3'
fetch-depth: 0

# actually merge from the previous branch
- name: Perform merge from 2021.2 to 2021.3
run: |
# setup to allow to merge and commit
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# actual merge operation
git merge --no-ff --message "Merge 2021.2 -> 2021.3" origin/mps/2021.2 -- || ( echo "Merge failed. Please merge manually!" ; exit 1 )
Expand All @@ -44,10 +44,11 @@ jobs:
- name: Create PR for MPS 2021.3
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MPS_REPO_PAT }}
branch: 'merge/2021.3'
commit-message: Merge mps/2021.2 into mps/2021.3
title: ${{ env.NEW_TITLE }} (2021.2 -> 2021.3)
body: |
This is an automatic PR which merges changes from `mps/2021.2` to `mps/2021.3`
[Link to previous PR for `mps/2020.3`](${{ github.event.pull_request._links.html.href }})
9 changes: 5 additions & 4 deletions .github/workflows/PR-into-2022-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
merge-and-PR-into-2022-2:
# only trigger if it was actually merged
if: github.event.pull_request.merged == true

runs-on: ubuntu-latest
steps:

Expand All @@ -21,14 +21,14 @@ jobs:
with:
ref: 'mps/2022.2'
fetch-depth: 0

# actually merge from the previous branch
- name: Perform merge from 2021.3 to 2022.2
run: |
# setup to allow to merge and commit
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# actual merge operation
git merge --no-ff --message "Merge 2021.3 -> 2022.2" origin/mps/2021.3 -- || ( echo "Merge failed. Please merge manually!" ; exit 1 )
Expand All @@ -44,10 +44,11 @@ jobs:
- name: Create PR for MPS 2022.2
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MPS_REPO_PAT }}
branch: 'merge/2022.2'
commit-message: Merge mps/2022.3 into mps/2022.2
title: ${{ env.NEW_TITLE }} (2021.3 -> 2022.2)
body: |
This is an automatic PR which merges changes from `mps/2021.3` to `mps/2022.2`
[Link to previous PR for `mps/2021.3`](${{ github.event.pull_request._links.html.href }})

0 comments on commit 1b54856

Please sign in to comment.