Skip to content

Commit 20ab82a

Browse files
authored
Add a CHANGELOG checking CI job (#30)
Add a Ci check that checks if the CHANGELOG was updated in a PR. Based on the command: ```bash git fetch origin $GITHUB_BASE_REF HEAD_SHA=$(git rev-parse HEAD) BASE_SHA=$(git rev-parse origin/$GITHUB_BASE_REF) git diff --exit-code $HEAD_SHA $BASE_SHA -- CHANGELOG.md || exit 0 && exit 1 ```
1 parent 92b953e commit 20ab82a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/changelog.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 📜 Check CHANGELOG update on PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "develop"
7+
8+
jobs:
9+
formatting-check:
10+
name: 📜 Check CHANGELOG update on PR
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Check changelog diff compared to target branch
15+
# If the changelog is not edit the job should fail
16+
run: |
17+
git fetch origin $GITHUB_BASE_REF
18+
HEAD_SHA=$(git rev-parse HEAD)
19+
BASE_SHA=$(git rev-parse origin/$GITHUB_BASE_REF)
20+
git diff --exit-code $HEAD_SHA $BASE_SHA -- CHANGELOG.md || exit 0 && exit 1

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to:
1717
* Added Github Actions for (cargo check, cargo fmt, cargo clippy, cargo test) [#10](https://github.com/Allstreamer/pyver/pull/10)
1818
* Added CHANGELOG.md
1919
* Added `ids` module
20+
* Added the capability to use the `PackageVersion` struct as a HashMap key [#28](https://github.com/Rust-Python-Packaging/pyver/pull/28)
2021

2122
### Changed
2223

0 commit comments

Comments
 (0)