[Release Note] New Dash GA #724
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 | |
| ext="${filename##*.}" | |
| # Check for multiple dots in the filename (excluding extension) | |
| if [[ "$name" == *.* ]]; then | |
| echo "Invalid file: $file (multiple dots in filename)" | |
| exit 1 | |
| fi | |
| # Check for missing .md extension | |
| if [[ "$ext" != "md" ]]; then | |
| echo "Invalid file: $file (missing .md extension)" | |
| exit 1 | |
| fi | |
| done |