update pull_request_template #682
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: Trigger a cluster test on a PR | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| issues: read | |
| pull-requests: read | |
| id-token: write | |
| jobs: | |
| get_head: | |
| runs-on: self-hosted-docker-tiny | |
| outputs: | |
| sha: ${{ steps.get_head.outputs.sha }} | |
| repo: ${{ steps.get_head.outputs.repo }} | |
| steps: | |
| - name: Get head SHA | |
| id: get_head | |
| run: | | |
| set -euo pipefail | |
| query='query pullRequestDetails { repository(name: \"${{ github.event.repository.name }}\", owner: \"${{ github.repository_owner }}\") { pullRequest(number: ${{ github.event.issue.number }}) { headRef { target { oid } } } } }' | |
| result=$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d " { \"query\": \"$query\" } " https://api.github.com/graphql) | |
| sha=$(echo "$result" | jq -r '.data.repository.pullRequest.headRef.target.oid') | |
| echo "sha=$sha" >> "$GITHUB_OUTPUT" | |
| trigger_cluster_test_basic: | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/cluster_test') | |
| needs: get_head | |
| uses: ./.github/workflows/cluster_tests.yml | |
| secrets: inherit | |
| with: | |
| workflow: cluster_test | |
| sha: ${{ needs.get_head.outputs.sha }} | |
| result: | |
| runs-on: self-hosted-docker-tiny | |
| needs: | |
| - trigger_cluster_test_basic | |
| - get_head | |
| steps: | |
| - run: | | |
| number=$(echo '${{ needs.trigger_cluster_test_basic.outputs.result }}' | jq -r '.number') | |
| echo "Deploy scratchnet pipeline triggered for [Commit ${{ needs.get_head.outputs.sha }} in ${{ needs.get_head.outputs.repo }}](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/files/${{ needs.get_head.outputs.sha }}), please approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/${number}" | |
| trigger_cluster_test_hdm: | |
| if: github.event.issue.pull_request && contains(github.event.comment.body, '/hdm_test') | |
| needs: get_head | |
| uses: ./.github/workflows/cluster_tests.yml | |
| secrets: inherit | |
| with: | |
| workflow: hdm_test | |
| sha: ${{ needs.get_head.outputs.sha }} | |
| result_hdm: | |
| runs-on: self-hosted-docker-tiny | |
| needs: | |
| - trigger_cluster_test_hdm | |
| - get_head | |
| steps: | |
| - run: | | |
| number=$(echo '${{ needs.trigger_cluster_test_hdm.outputs.result }}' | jq -r '.number') | |
| echo "Deploy scratchnet HDM pipeline triggered for [Commit ${{ needs.get_head.outputs.sha }} in ${{ needs.get_head.outputs.repo }}](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/files/${{ needs.get_head.outputs.sha }}), please approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/${number}" |