Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions .github/workflows/ci_android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ on:
- opened
- reopened
- synchronize
paths:
- "**/*.kt"
- "**/*.kts"
- "**/*.xml"
- "app/src/**"
- ".github/workflows/ci_android.yaml"
push:
branches:
- main
paths:
- "**/*.kt"
- "**/*.kts"
- "**/*.xml"
- "app/src/**"
- ".github/workflows/ci_android.yaml"

permissions:
pull-requests: write
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/ci_changelog_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ci_changelog_check

# Runs on every PR event that could change which files are included.
# 'labeled' and 'unlabeled' are needed so that adding/removing the
# 'no-changelog' label immediately re-evaluates the check.
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

permissions:
contents: read
pull-requests: read

jobs:
changelog_check:
runs-on: ubuntu-latest
name: Check Changelog Entry

# Skip the whole job (shows as "skipped" = passing) when a maintainer
# has deliberately labelled the PR 'no-changelog'.
# Typical use-cases: CI-only fixes, typo corrections, dependency bumps.
if: "!contains(github.event.pull_request.labels.*.name, 'no-changelog')"

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Full history is required so tj-actions/changed-files can compare
# the PR branch against the base branch correctly.
fetch-depth: 0

- name: Detect changed files
id: changed_files
uses: tj-actions/changed-files@v47
with:
# Check CHANGELOG.md and CHANGELOG_CONJUGATE.md.
files: CHANGELOG*.md

- name: Fail — no changelog entry found
if: steps.changed_files.outputs.any_changed == 'false'
run: |
echo "::error file=CHANGELOG.md::Missing changelog entry. Please add one before merging."
echo ""
echo "Every user-facing pull request must include an update to CHANGELOG.md"
echo "or CHANGELOG_CONJUGATE.md. If this PR genuinely does not need a changelog"
echo "entry (e.g. a CI fix, a typo correction, or a dependency bump), ask a"
echo "maintainer to add the 'no-changelog' label to skip this check."
exit 1

- name: Pass — changelog entry found
if: steps.changed_files.outputs.any_changed == 'true'
run: echo "CHANGELOG.md or CHANGELOG_CONJUGATE.md was updated. Check passed."
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).
- Unit tests and code coverage were written for the project ([#181](https://github.com/scribe-org/Scribe-Android/issues/181), [#196](https://github.com/scribe-org/Scribe-Android/issues/196)).
- GitHub Actions based CI was set up with unit and instrumentation tests ([#195](https://github.com/scribe-org/Scribe-Android/issues/195), [#212](https://github.com/scribe-org/Scribe-Android/issues/212), [#422](https://github.com/scribe-org/Scribe-Android/issues/422), [#580](https://github.com/scribe-org/Scribe-Android/issues/580)).
- prek based pre-commit hooks were added to the repo to catch common mistakes on commit ([#215](https://github.com/scribe-org/Scribe-Android/issues/215)).
- A CI workflow to enforces `CHANGELOG.md` or `CHANGELOG_CONJUGATE.md` updates on all PRs targeting `main`, with support for a `no-changelog` label to skip the check when appropriate.

### 📝 Documentation

Expand Down
Loading