Skip to content

[README.md] Improve wording and denote source #21

[README.md] Improve wording and denote source

[README.md] Improve wording and denote source #21

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 }})'
})