Merging vanvleeta/trr-contributions into main #18
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: Index new TRR on merge | |
| run-name: Merging ${{ github.event.pull_request.head.repo.full_name }} into main | |
| on: | |
| pull_request_target: | |
| types: | |
| - closed | |
| branches: | |
| - main | |
| jobs: | |
| assign-trr-numbers: | |
| if: ${{ github.event.pull_request.merged == true }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Get list of TRRs changed in PR | |
| id: changed-markdown-files | |
| uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 | |
| with: | |
| files: "reports/**/README.md" | |
| - name: Update modified TRRs using indexer | |
| if: steps.changed-markdown-files.outputs.any_changed == 'true' | |
| run: python3 tools/index/index.py merge -f ${{ steps.changed-markdown-files.outputs.all_changed_files }} | |
| - name: Commit and push updated files to main | |
| run: | | |
| git config --local user.email "TRR-Bot@users.noreply.github.com" | |
| git config --local user.name "TRR-Bot" | |
| git add . | |
| git diff --cached --quiet || git commit -m "Reindexing TRRs after merging PR #${{ github.event.pull_request.number }}" | |
| git push origin main | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |