Skip to content

Create Release PR

Create Release PR #67

name: Create Release PR
on:
workflow_dispatch:
jobs:
create_release_01:
name: Create Pull Request to master
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.calculate_version.outputs.new_version }}
steps:
- uses: actions/checkout@v4
- name: Calculate new version
id: calculate_version
run: |
new_version=$(bin/next_version.sh | cut -d'=' -f2)
echo "new_version=$new_version" >> $GITHUB_OUTPUT
# The changes here will be overwritten, however we need changes, else the PR will be automatically closed by GitHub
- name: Dummy Changes to keep PR open
run: |
echo "Dummy Change" >> .env
- name: Create Pull Request to master branch
id: cpr-main
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: create_release_01 release v${{ steps.calculate_version.outputs.new_version }}
committer: Catrobot <Catrobot@catroweb.github.com>
title: 'Release v${{ steps.calculate_version.outputs.new_version }} into master'
body: |
### Release v${{ steps.calculate_version.outputs.new_version }}
Release ToDo List:
- [X] Bump our version code
- [X] Create new Release/Tag on GitHub
This pull request is autogenerated using GitHub Actions.
For more information checkout the action '.github/workflows/create_release_pull_request.yaml'
labels: automated, new-release, master
branch: release/v${{ steps.calculate_version.outputs.new_version }}
delete-branch: true
reviewers: dmetzner
base: master
create_release_02:
name: Create Pull Request to develop
runs-on: ubuntu-latest
needs: create_release_01
env:
new_version: ${{ needs.create_release_tag.outputs.new_version }}
steps:
- uses: actions/checkout@v4
- name: Set Version Code
run: |
sed -i -E "s/APP_VERSION='[0-9]+\.[0-9]+\.[0-9]+'/APP_VERSION='${{ env.new_version }}'/" .env
- name: Commit changes
run: |
git config --global user.name "Catrobot"
git config --global user.email "Catrobot@catroweb.github.com"
git commit -am "Bump version to ${{ env.new_version }}"
- name: Create Pull Request to develop branch
id: cpr-develop
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: create_release_01 release v${{ env.new_version }}
committer: Catrobot <Catrobot@catroweb.github.com>
title: 'Release v${{ env.new_version }} into develop'
body: |
### Release v${{ env.new_version }}
Release ToDo List:
- [X] Bump our version code
- [X] Create new Release/Tag on GitHub
This pull request is autogenerated using GitHub Actions.
For more information checkout the action '.github/workflows/create_release_pull_request.yaml'
labels: automated, new-release
branch: release/v${{ env.new_version }}
delete-branch: true
reviewers: dmetzner
base: develop
create_release_tag:
name: Create GitHub Release v${{ env.new_version }}

Check failure on line 94 in .github/workflows/create_release_pull_request.yaml

View workflow run for this annotation

GitHub Actions / Create Release PR

Invalid workflow file

The workflow is not valid. .github/workflows/create_release_pull_request.yaml (Line: 94, Col: 11): Unrecognized named-value: 'env'. Located at position 1 within expression: env.new_version
runs-on: ubuntu-latest
needs: [create_release_01, create_release_02]
env:
new_version: ${{ needs.create_release_tag.outputs.new_version }}
steps:
- uses: actions/checkout@v4
- name: Checkout Release Branch
run: git checkout release/v${{ env.new_version }}
- name: Generate Release Notes
id: generate_notes
run: |
notes=$(git log --pretty=format:"* %s" `git describe --tags --abbrev=0`..HEAD)
echo "release_notes=$notes" >> $GITHUB_OUTPUT
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
notes=$(git log --pretty=format:"* %s" `git describe --tags --abbrev=0`..HEAD)
gh release create v${{ env.new_version }} --target release/v${{ env.new_version }} -t "v${{ env.new_version }}" -n "$notes"