WIP: starting on GitHub Action and App branch #144
This file contains hidden or 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
name: Check Release Notes Filenames | |
on: | |
pull_request: | |
jobs: | |
check-filenames: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 # Ensures we have at least one previous commit for diffing | |
- name: Find invalid filenames in added/modified files | |
run: | | |
git fetch origin ${{ github.base_ref }} --depth=1 | |
git diff --name-only --diff-filter=A origin/${{ github.base_ref }} | grep '^source/releasenotes/' | while read -r file; do | |
filename=$(basename "$file") | |
name="${filename%.*}" # Remove only the last extension | |
if [[ "$name" == *.* ]]; then | |
echo "Invalid file: $file" | |
exit 1 | |
fi | |
done |