Skip to content

Commit

Permalink
Merge pull request eclipse-tractusx#628 from catenax-ng/feature/TRI-2…
Browse files Browse the repository at this point in the history
…24-workflow-to-check-changelog

feat(impl):[TRI-224] changelog check workflow action
  • Loading branch information
ds-ext-kmassalski authored Nov 10, 2023
2 parents 0160ab6 + e8f5c78 commit 369470b
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/changelog-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Check if CHANGELOG file was modified in PR"

on:
pull_request:
branches: main
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.config/**'
- '.github/**'
- 'docs/**'
- 'local/**'

jobs:
analyze:
runs-on: ubuntu-latest
permissions:
pull-requests: write

name: changelog-check
steps:
- uses: actions/checkout@v4

- name: Check if CHANGELOG file was changed
id: changelog-changed
uses: tj-actions/changed-files@v40
with:
files: |
CHANGELOG.md
- name: Echo result if CHANGELOG file was changed
if: steps.changelog-changed.outputs.any_changed == 'true'
run: |
for file in ${{ steps.changelog-changed.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Find previous comment in PR
if: steps.changelog-changed.outputs.any_changed == 'false'
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: CHANGELOG file was not updated! Make sure to include important changes.

- name: Create or update comment in PR
if: steps.changelog-changed.outputs.any_changed == 'false'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
CHANGELOG file was not updated! Make sure to include important changes.
edit-mode: replace

0 comments on commit 369470b

Please sign in to comment.