-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: ask users to provide towncrier snippet
If the release-notes entry isn't required, tag the PR with 'no-release-notes' label and re-run the wokflow. While on it, provide a TL;DR documentation to simplify the steps for the first time contributors.
- Loading branch information
Showing
3 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
name: Check that ChangeLog has been modified | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
changed_files: | ||
runs-on: ubuntu-latest | ||
name: Test that towncrier file exists | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
since_last_remote_commit: true | ||
|
||
- name: Detect the missing Release Notes entry | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OWNER: ${{ github.repository_owner }} | ||
REPO_NAME: ${{ github.event.repository.name }} | ||
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} | ||
run: | | ||
labels="$(gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER --jq '.labels.[].name')" | ||
status=false | ||
case $labels in | ||
*no-release-notes*) | ||
echo "No release notes entry expected." | ||
exit 0 | ||
;; | ||
esac | ||
for file in ${ALL_CHANGED_FILES}; do | ||
case $file in | ||
*release-notes-next*) | ||
status=true | ||
;; | ||
esac | ||
done | ||
if $status; then | ||
echo "Thank you for providing the release note snippet!" | ||
else | ||
echo "Please provide release notes snippet, per the instructions" | ||
echo https://rpm-software-management.github.io/mock/Release-Notes-New-Entry | ||
fi | ||
$status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.