-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (35 loc) · 1.33 KB
/
test-action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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