Add PyCon APAC Philippines #210
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: Test Pull Request | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Validate event files (schema) | |
| run: npm run validate | |
| - name: Ensure no duplicate event files | |
| run: | | |
| FILES=$(ls data/events/*.json | sed 's#.*/##') | |
| DUPLICATES=$(echo "$FILES" | sort | uniq -d) | |
| if [ -n "$DUPLICATES" ]; then | |
| for f in $DUPLICATES; do | |
| echo "::error file=data/events/$f::Duplicate event file name" | |
| done | |
| exit 1 | |
| fi | |
| echo "No duplicate filenames found." | |
| - name: Ensure no duplicate event names | |
| run: | | |
| NAMES=$(jq -r '.name' data/events/*.json) | |
| DUPLICATES=$(echo "$NAMES" | sort | uniq -d) | |
| if [ -n "$DUPLICATES" ]; then | |
| for name in $DUPLICATES; do | |
| file=$(grep -Rl "\"name\": \"$name\"" data/events) | |
| echo "::error file=$file::Duplicate event name \"$name\"" | |
| done | |
| exit 1 | |
| fi | |
| echo "No duplicate event names found." | |
| - name: Ensure JSON is valid | |
| run: | | |
| for f in data/events/*.json; do | |
| if ! jq empty "$f" >/dev/null 2>&1; then | |
| echo "::error file=$f::Invalid JSON format" | |
| exit 1 | |
| fi | |
| done | |
| echo "All JSON files are well-formatted." |