Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow for changelog verification #4085

Merged
merged 7 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/changelog_verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Changelog Verifier"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not all PRs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default mechanism for pull_request trigger is as follows:

By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened.

I have updated the GHA config to reflect all the types I found could match our case.


jobs:
# Enforces the update of a changelog file on every pull request
verify-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: dangoslen/dependabot-changelog-helper@v1

- uses: stefanzweifel/git-auto-commit-action@v4.14.1
with:
commit_message: "Update changelog"

- uses: dangoslen/changelog-enforcer@v3
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CHANGELOG
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [ UNRELEASED ]
### Added
- Github workflow for changelog verification
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's start with a format that includes a link to the PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only concern I have with that is it will become a 2 step process -

  1. Add changelog with dummy link and raise the PR
  2. Update the changelog and commit again with the PR link

Let me check if there is an automated mechanism/property within the used GHA to achieve this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working backwards from the end goal of users being able to find what the change was I think that's an acceptable overhead.


### Changed

### Deprecated

### Removed

### Fixed

### Security