diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9a7e560..8f9f3be 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,8 +2,9 @@ on: pull_request: types: [opened, synchronize, edited, review_requested, ready_for_review] name: PR -env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + +permissions: + contents: read jobs: format: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 23e2e7c..5f914e0 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -4,6 +4,9 @@ on: - "*" name: Push +permissions: + contents: read + jobs: clippy_check: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfa8dfa..cc5163e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,7 @@ -on: [release] +on: + release: + types: + - published jobs: changelog: @@ -19,11 +22,36 @@ jobs: OUTPUT: CHANGELOG.md GITHUB_REPO: ${{ github.repository }} - - name: Commit + - name: Create Changelog Branch run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' set +e + git switch -c update_changelog git add CHANGELOG.md - git commit --no-verify -m "Update changelog" - git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git master + git commit --no-verify -m "Update changelog after release" + git push -f https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git update_changelog + + + - name: Create Changelog Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update changelog after release + committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> + signoff: false + base: master + branch: update_changelog + delete-branch: true + title: 'Update changelog after release' + body: | + Automatic changelog update using git cliff + - Auto-generated after latest release + :artificial_satellite: :rocket: :newspaper: + labels: | + documentation + assignees: RakuJa + reviewers: RakuJa + draft: false diff --git a/cliff.toml b/cliff.toml index 51916d0..8decf21 100644 --- a/cliff.toml +++ b/cliff.toml @@ -60,7 +60,6 @@ commit_parsers = [ { message = "^test", group = "Fixed" }, { message = "^fix", group = "Fixed" }, { message = "^.*: fix", group = "Fixed" }, - { message = "^.*", group = "Changed" }, ] # protect breaking changes from being skipped due to matching a skipping commit_parser protect_breaking_commits = false @@ -69,7 +68,7 @@ filter_commits = true # regex for matching git tags tag_pattern = "v[0-9].*" # regex for skipping tags -skip_tags = "v0.1.0-beta.1" +skip_tags = "" # regex for ignoring tags ignore_tags = "" # sort the tags topologically