-
Notifications
You must be signed in to change notification settings - Fork 4
31 lines (27 loc) · 1.29 KB
/
02_get_artifact.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
name: Get Artifact
on: pull_request
jobs:
get_artifact:
runs-on: ubuntu-latest
steps:
- name: Grab last artifact
id: last_artifact
run: |
sleep 20
runs=$(curl -s https://api.github.com/repos/sailfishos-patches/sailfish-qml/actions/workflows/3182534/runs)
check_suite_id=$(echo $runs | jq ".workflow_runs[0].check_suite_id")
run_id=$(echo $runs | jq ".workflow_runs[0].id")
artifact_id=$(curl -s https://api.github.com/repos/sailfishos-patches/sailfish-qml/actions/runs/${run_id}/artifacts | jq ".artifacts[0].id")
archive_download_url="https://github.com/sailfishos-patches/sailfish-qml/suites/${check_suite_id}/artifacts/${artifact_id}"
echo "::set-output name=archive_download_url::${archive_download_url}"
- name: 'Comment PR'
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hello @${{ github.event.pull_request.user.login }}\nYour patch is ready!\n\n[Download link](${{ steps.last_artifact.outputs.archive_download_url }})'
})