add scratchnet stack files #6
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
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| pull_request_target: | |
| types: [opened, reopened, synchronize] | |
| 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 & repo | |
| id: get_head | |
| run: | | |
| query='query pullRequestDetails { repository(name: \"${{ github.event.repository }}\", owner: \"${{ github.event.organization }}\") { pullRequest(number: 416) { headRef { target { oid } } headRepository { sshUrl } } } }' | |
| result=$(curl -H "Authorization: Bearer $GITHUB_TOKEN" -X POST -d " { \"query\": \"$query\" } " https://api.github.com/graphql) | |
| sha=$(echo "$result" | jq -r '.data.repository.pullRequest.headRef.target.oid') | |
| repo=$(echo "$result" | jq -r '.data.repository.pullRequest.headRepository.sshUrl') | |
| test: | |
| runs-on: self-hosted-docker-tiny | |
| needs: get_head | |
| steps: | |
| - name: Run tests | |
| run: | | |
| echo "Running tests for commit ${{ needs.get_head.outputs.sha }} in ${{ needs.get_head.outputs.repo }}" |