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
37 changes: 37 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Changelog

# Every PR that changes the published SDK must add an entry under
# [Unreleased] in CHANGELOG.md. Apply the `skip-changelog` label to PRs whose
# changes are not user-facing (refactors, tests, build tweaks).
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
changelog:
name: CHANGELOG entry
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changelog') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Require a CHANGELOG.md entry for SDK changes
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
# Files that ship in the published artifact (tests excluded below).
SDK_PATHS: '^(src/|android/|ios/|plugin/|app\.plugin\.js$|middleware-react-native\.podspec$)'
TEST_PATHS: '/__tests__/'
run: |
changed=$(git diff --name-only "$BASE_SHA"...HEAD)
if ! echo "$changed" | grep -E "$SDK_PATHS" | grep -qvE "$TEST_PATHS"; then
echo "No SDK changes; no CHANGELOG entry needed."
exit 0
fi
if echo "$changed" | grep -qx 'CHANGELOG.md'; then
echo "CHANGELOG.md updated."
exit 0
fi
echo "::error file=CHANGELOG.md::This PR changes the SDK but not CHANGELOG.md. Add a bullet under [Unreleased], or apply the skip-changelog label if nothing changes for app developers."
exit 1
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3
- name: verify changelog
run: python3 scripts/changelog.py check "$VERSION"
env:
VERSION: ${{ github.event.inputs.version }}
- name: node
uses: actions/setup-node@v3
with:
Expand All @@ -34,11 +38,16 @@ jobs:
env:
TAG: ${{ github.event.inputs.version }}

- name: Build Changelog
- name: Read release notes from CHANGELOG.md
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
run: |
{
echo 'changelog<<CHANGELOG_EOF'
python3 scripts/changelog.py notes "$VERSION"
echo 'CHANGELOG_EOF'
} >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}

- name: Create Release
uses: mikepenz/action-gh-release@v0.2.0-a03
Expand Down
Loading
Loading