Update Release PR #11
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
name: Update Release PR | |
on: | |
workflow_dispatch: {} | |
jobs: | |
push_to_registry: | |
name: Update PR for Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Check branch | |
run: | | |
echo ${GITHUB_REF#refs/heads/} | grep release | |
if [ $? -ne 0 ]; then | |
echo "Invalid branch chosen" | |
exit 1; | |
fi | |
- name: Initialize mandatory git config | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email noreply@github.com | |
- name: Extract version | |
shell: bash | |
run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/heads/release/})" | |
id: extract-version | |
- name: Update version file | |
id: make-commit | |
run: | | |
git commit --allow-empty --message "Prepare release ${{ steps.extract-version.outputs.version }}" | |
echo "::set-output name=commit::$(git rev-parse HEAD)" | |
- name: Push release branch | |
run: git push origin release/${{ steps.extract-version.outputs.version }} | |
- name: Create pull request into main | |
uses: thomaseizinger/create-pull-request@1.3.0 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
head: release/${{ steps.extract-version.outputs.version }} | |
base: main | |
title: Update Release ${{ steps.extract-version.outputs.version }} | |
reviewers: ${{ github.event.issue.user.login }} | |
body: | | |
Update Release PR for ${{ steps.extract-version.outputs.version }} | |
I've updated the version name and committed: ${{ steps.make-commit.outputs.commit }}. |