Create BLANK.md file as specified in PLAY-35 #1
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: Jira Callback on PR Update | |
| on: | |
| pull_request: | |
| types: [synchronize] | |
| jobs: | |
| check-files: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| count: ${{ steps.files.outputs.count }} | |
| steps: | |
| - name: Get changed files | |
| id: files | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const files = await github.rest.pulls.listFiles({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.payload.pull_request.number | |
| }); | |
| core.setOutput("count", files.data.length); | |
| test: | |
| needs: check-files | |
| if: ${{ needs.check-files.outputs.count > 0 }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: npm ci | |
| - run: npm test | |
| notify: | |
| needs: test | |
| if: ${{ success() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Call webhook | |
| run: | | |
| curl -X POST -H "Content-Type: application/json" \ | |
| -d "{\"status\":\"success\",\"pr\":\"${{ github.event.pull_request.html_url }}\"}" \ | |
| "${{ secrets.WEBHOOK_URL }}" |