Skip to content

Create release PR

Create release PR #198

Workflow file for this run

name: Create release PR
on:
workflow_dispatch:
branches:
- main
jobs:
release-notes:
name: Build Changelog
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
fetch-depth: 0
- name: Computed envs
run: |
echo "DATE=$(date +'%d.%m.%Y')" >> $GITHUB_ENV
echo "FROM_TAG=$(git merge-base --fork-point origin/main)" >> $GITHUB_ENV
echo "SHA - ${{ github.sha }}"
- name: Build Changelog
id: github_release
uses: mikepenz/[email protected]
with:
fromTag: ${{ env.FROM_TAG }}
toTag: ${{ github.sha }}
configuration: "./.github/workflows/changelog-builder-config.json"
- name: Create "changelog_artifacts.md"
run: |
cat > ${{ github.workspace }}/changelog_artifacts.md <<'EOF'
${{ steps.github_release.outputs.changelog }}
- name: Lint
run: |
sed -i -E 's|(<img [^>]*[^/])>|\1/>|' ${{ github.workspace }}/changelog_artifacts.md
- name: Upload "changelog_artifacts.md"
uses: actions/upload-artifact@master
with:
name: release-changelog-artifacts
path: ${{ github.workspace }}/changelog_artifacts.md
- name: Create release PR
run: |
body="# Release Notes
$(cat ${{ github.workspace }}/changelog_artifacts.md)"
gh pr create --base main --head dev --title "Release by ${{ env.DATE }}" --body "$body"