Skip to content

more branch magic in the workflow #13

more branch magic in the workflow

more branch magic in the workflow #13

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: PublishReleaseAndModule
on:
push:
tags:
- 'v*'
jobs:
release:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 2
- name: Get changelog
id: get-changelog
uses: release-flow/keep-a-changelog-action@v2
with:
command: query
version: unreleased
- uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.ref_name }}
draft: true
body: ${{ steps.get-changelog.outputs.release-notes }}
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
tag: ${{ github.ref }}
- name: Push changelog
run: |
# Configure git with github-actions bot to make commits more pretty
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b changelog/${{ github.ref_name }}
git add CHANGELOG.md
git commit -m "docs: update changelog for ${{ github.ref_name }}"
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update changelog for ${{ github.ref_name }}"
title: Update changelog for ${{ github.ref_name }}
body: Automatic update of changelog for release ${{ github.ref_name }}.
branch: main
labels: documentation
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- name: Merge Pull Request
uses: juliangruber/merge-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create-pull-request.outputs.pull-request-number }}