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
24 changes: 14 additions & 10 deletions .github/workflows/pull-request-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,30 @@ jobs:
id: check_folders
run: |
missing_changelogs=""

for folder in api ui prowler; do
if grep -q "^${folder}/" changed_files.txt; then
echo "Detected changes in ${folder}/"
if ! grep -q "^${folder}/CHANGELOG.md$" changed_files.txt; then
echo "No changelog update found for ${folder}/"
missing_changelogs="${missing_changelogs}${folder} "
missing_changelogs="${missing_changelogs}- \`${folder}\`\n"
fi
fi
done

echo "missing_changelogs=${missing_changelogs}" >> $GITHUB_OUTPUT

echo "missing_changelogs<<EOF" >> $GITHUB_OUTPUT
echo -e "${missing_changelogs}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Comment on PR if changelog is missing
if: steps.check_folders.outputs.missing_changelogs != ''
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body-identifier: changelog-check
body: |
⚠️ **Changes detected in the following folders that have not been updated in your CHANGELOG.md**:
${{ steps.check_folders.outputs.missing_changelogs }}

Please add an entry to the corresponding `CHANGELOG.md` to maintain a clear history of changes.
${{ steps.check_folders.outputs.missing_changelogs != '' && format(
'⚠️ **Changes detected in the following folders without a corresponding update to the `CHANGELOG.md`:**

{0}

Please add an entry to the corresponding `CHANGELOG.md` file to maintain a clear history of changes.', steps.check_folders.outputs.missing_changelogs) || '✅ All necessary CHANGELOG.md files have been updated. Great job! 🎉' }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.code
.idea
4 changes: 3 additions & 1 deletion api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
API Changelog
API Changelog

- New file `hello-world.txt`
Empty file added api/hello-world.txt
Empty file.
4 changes: 3 additions & 1 deletion prowler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Prowler Changelog
Prowler Changelog

- New file `hello-world.txt`
Empty file added prowler/hello-world.txt
Empty file.
3 changes: 3 additions & 0 deletions ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UI Changelog

- New file `hello-world.txt`
Empty file added ui/hello-world.txt
Empty file.
Loading