Merge pull request #1 from BiscuitCoder/main #3
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: Update Hackathon Information | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'registration/*.md' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'registration/*.md' | |
| jobs: | |
| update-hackathon: | |
| if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: pip install pyyaml | |
| - name: Debug modified or added files | |
| run: | | |
| echo "Modified or added files:" | |
| git diff --no-commit-id --name-only --diff-filter=AM -r HEAD -- 'demos/' 'registration/' | |
| - name: Update hackathon information | |
| run: | | |
| python scripts/update_hackathon.py | |
| - name: Commit and push changes | |
| run: | | |
| if git diff --quiet README.md; then | |
| echo "No changes to files. Skipping commit." | |
| else | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add README.md | |
| git commit -m "Update hackathon information" | |
| git pull --rebase origin main | |
| git push | |
| fi |