Skip to content

[Internal] Add workflow to validate NEXT_CHANGELO.go updates #20

[Internal] Add workflow to validate NEXT_CHANGELO.go updates

[Internal] Add workflow to validate NEXT_CHANGELO.go updates #20

name: Check for NEXT_CHANGELOG.md Changes
on:
pull_request: # Trigger on pull request events
jobs:
check-next-changelog:
runs-on:
group: databricks-deco-testing-runner-group
labels: ubuntu-latest-deco
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Fetch list of changed files
id: changed-files
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Use the GitHub API to fetch changed files
files=$(gh pr view ${{ github.event.pull_request.number }} --json files -q '.files[].path')
# Setting the 'files' environment variable in GitHub Actions
echo "files<<EOF" >> $GITHUB_ENV
echo "$files" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Verify NEXT_CHANGELOG.md was modified
run: |
# Check if NEXT_CHANGELOG.md exists in the list of changed files
echo "Changed files: $files"
if [[ ! "$files" =~ NEXT_CHANGELOG\.md ]]; then
echo "WARNING: file NEXT_CHANGELOG.md not modified in this PR.\
This is just a reminder and does not block the PR from merging."
exit 1
fi