Update test-action.yml #102
This file contains 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: Action | |
on: | |
pull_request: # When a PR is opened, edited, updated, or a label is added. | |
types: [opened, synchronize, labeled, edited] | |
push: | |
branches: | |
- master # Every time a PR is merged to master. | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: "Run sync of ${{ matrix.network }} testnet" | |
steps: | |
- name: Show GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
shell: bash | |
- name: Log stuff | |
run: | | |
echo "Network: ${{ matrix.network }}" | |
echo "Checkpoint sync URL: ${{ matrix.checkpoint-sync-url }}" | |
- name: Get Job ID | |
id: get_job_id | |
run: | | |
JOB_JSON=$(curl -sS -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs") | |
JOB_ID=$(echo $JOB_JSON | jq -r '.jobs[] | select(.name == "${{ github.job }}") | .id') | |
echo "JOB_ID=$JOB_ID" >> $GITHUB_OUTPUT | |
- name: Use Job ID | |
run: | | |
JOB_ID=${{ steps.get_job_id.outputs.JOB_ID }} | |
JOB_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/$JOB_ID" | |
echo "Job URL: $JOB_URL" | |
# Use $JOB_URL in your notification |