Create release PR #205
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: 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 "HEAD_REF - {{github.head_ref}}" | |
- 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" | |