Skip to content

Commit a5a7f94

Browse files
committed
.
1 parent 8891f67 commit a5a7f94

File tree

3 files changed

+19
-31
lines changed

3 files changed

+19
-31
lines changed

.github/workflows/cluster_tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
sha:
1010
type: string
1111
required: true
12+
splice_url:
13+
type: string
14+
required: true
1215

1316
outputs:
1417
result:
@@ -39,5 +42,5 @@ jobs:
3942
run: |
4043
set -euo pipefail
4144
result=$(curl -sSfL -H "Authorization: Bearer ${{ steps.auth.outputs.id_token }}" \
42-
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}")
45+
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}&splice-url=${{ inputs.splice_url }}" \)
4346
echo "result=$result" >> "$GITHUB_OUTPUT"

.github/workflows/post_merge.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/pr_cluster_test.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,39 @@ permissions:
1010

1111
jobs:
1212

13-
get_sha:
13+
get_head:
1414
runs-on: self-hosted-docker-tiny
1515
outputs:
16-
sha: ${{ steps.comment-branch.outputs.head_sha }}
16+
sha: ${{ steps.get_head.outputs.sha }}
17+
repo: ${{ steps.get_head.outputs.repo }}
1718
steps:
18-
- name: Get PR branch
19-
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
20-
id: comment-branch
19+
- name: Get head SHA & repo
20+
id: get_head
21+
run: |
22+
query='query pullRequestDetails { repository(name: "${{ github.event.repository }}", owner: "${{ github.event.organization }}") { pullRequest(number: ${{ github.event.issue.number }}) { headRef { target { oid } } headRepository { sshUrl } } } }'
23+
result=$(gh api graphql -F query="$query")
24+
sha=$(echo "$result" | jq -r '.data.repository.pullRequest.headRef.target.oid')
25+
repo=$(echo "$result" | jq -r '.data.repository.pullRequest.headRepository.sshUrl')
2126
2227
trigger_cluster_test_basic:
2328
if: github.event.issue.pull_request && contains(github.event.comment.body, '/cluster_test')
24-
needs: get_sha
29+
needs: get_head
2530
uses: ./.github/workflows/cluster_tests.yml
2631
secrets: inherit
2732
with:
2833
workflow: cluster_test
29-
sha: ${{ needs.get_sha.outputs.sha }}
34+
sha: ${{ needs.get_head.outputs.sha }}
35+
splice_url: ${{ needs.get_head.outputs.repo }}
3036

3137
result:
3238
runs-on: self-hosted-docker-tiny
3339
needs:
3440
- trigger_cluster_test_basic
35-
- get_sha
41+
- get_head
3642
steps:
3743
- run: |
3844
number=$(echo '${{ needs.trigger_cluster_test_basic.outputs.result }}' | jq -r '.number')
39-
echo "Deploy scratchnet pipeline triggered for [PR as of ${{ needs.get_sha.outputs.sha }}](https://github.com/${{ github.repository }}/pull/${{ github.event.issue.number }}/files/${{ needs.get_sha.outputs.sha }}), please approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/${number}"
45+
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}"
4046
4147
4248
trigger_cluster_test_hdm:

0 commit comments

Comments
 (0)