#8 Dodao svoje ime u Contributors #6
Workflow file for this run
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: Auto Merge Contributors PR | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| jobs: | |
| auto-merge: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install GitHub CLI | |
| uses: actions/checkout@v4 | |
| - name: Check that ONLY Contributors.md is changed | |
| run: | | |
| FILES=$(gh pr view ${{ github.event.pull_request.number }} --json files --jq '.files[].path') | |
| echo "Changed files:" | |
| echo "$FILES" | |
| # Uslojavanje: | |
| # 1. mora postojati samo jedan fajl | |
| # 2. mora biti baš Contributors.md | |
| if [ "$(echo "$FILES" | wc -l)" -ne 1 ] || [ "$FILES" != "Contributors.md" ]; then | |
| echo "Auto-merge STOP — PR menja više od jednog fajla ili nije Contributors.md" | |
| exit 1 | |
| fi | |
| echo "Validan PR — samo Contributors.md je promenjen." | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Auto merge | |
| run: | | |
| gh pr merge ${{ github.event.pull_request.number }} --merge | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |