Skip to content

Commit

Permalink
Trying out CasperWA/push-protected@v2
Browse files Browse the repository at this point in the history
  • Loading branch information
LitschiW committed Jul 2, 2023
1 parent ee6b73f commit 68e8c70
Showing 1 changed file with 7 additions and 28 deletions.
35 changes: 7 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,16 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout -B "MiSim-${{env.MAVEN_VERSION}}"
# git checkout -B "MiSim-${{env.MAVEN_VERSION}}"
mvn -B release:prepare release:perform
git clean -f

- name: Create Pull Request to Master
id: open-pr
uses: repo-sync/pull-request@v2
- name: Push to master
uses: CasperWA/push-protected@v2
with:
source_branch: "MiSim-${{env.MAVEN_VERSION}}"
pr_title: "Prepare Release ${{env.MAVEN_VERSION}}"
pr_body: "This pull request updates the MiSim pom for version ${{env.MAVEN_VERSION}} and prepares the next Snapshot.<br>It will be merged automatically."
pr_allow_empty: false
pr_label: "automerge"
github_token: ${{ secrets.PUBLISHER_TOKEN }}

- name: Automerge Pull Request
id: automerge
env:
PULL_REQUEST: ${{steps.open-pr.outputs.pr_number}}
MERGE_COMMIT_MESSAGE: 'Update to ${{env.MAVEN_VERSION}} and prepare next SNAPSHOT'
MERGE_DELETE_BRANCH: true
MERGE_RETRIES: 10
MERGE_RETRY_SLEEP: '60000'
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: "pascalgn/automerge-action@v0.15.6"
branch: master
tags: true
force: true
debug: true

- name: Check Merge Resreult
if: ${{ steps.automerge.outputs.mergeResult != 'merged' }}
run: |
echo "Merge of Pull Request ${{steps.open-pr.outputs.pr_number}} failed."
echo "Expected state 'merged', but found '${{steps.automerge.outputs.mergeResult}}'."
echo "See ${{steps.open-pr.outputs.pr_url}} for further info."
exit 1

0 comments on commit 68e8c70

Please sign in to comment.