Skip to content

pajlads/changelog-checker

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9a3e750 · Dec 18, 2023

History

16 Commits
Dec 7, 2023
Oct 4, 2023
Sep 16, 2023
Oct 4, 2023
Dec 18, 2023
Dec 18, 2023
Oct 4, 2023
Sep 16, 2023
Sep 16, 2023
Oct 4, 2023
Sep 16, 2023

Repository files navigation

Changelog Checker

If you follow the same changelog format I use, this action will allow you to make sure PRs don't accidentally add their entry into an already-released changelog section.

Usage

Simple unskippable checker

This will always run, and fail if a changelog entry has been place in the wrong section.

---
name: Changelog Checker

on: pull_request

jobs:
  changelog-check:
    runs-on: ubuntu-latest
    steps:
      - uses: pajlads/changelog-checker@v1.0.1

Skippable checker

This can let you skip the changelog checker with the label skip-changelog-checker

---
name: Changelog Checker

on:
  pull_request:
    types:
      - labeled
      - unlabeled
      - opened
      - synchronize
      - reopened

jobs:
  changelog-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v6
        id: label-checker
        with:
          result-encoding: "string"
          script: |
            const response = await github.rest.issues.listLabelsOnIssue({
              issue_number: context.payload.pull_request.number,
              owner: context.repo.owner,
              repo: context.repo.repo
            });
            if (new Set(response.data.map(label => label.name)).has("skip-changelog-checker")) {
              return "skip";
            }
            return "";

      - uses: pajlads/changelog-checker@v1.0.1
        if: steps.label-checker.outputs.result != 'skip'

Contributing

When wanting to make a release, increase the version number in this file & in the Dockerfile in the same commit.

When the commit has landed in the main branch, tag it & the packages will be pushed automatically.