Skip to content
Snippets Groups Projects
Commit 37d53e2a authored by Alexander V. Tikhonov's avatar Alexander V. Tikhonov Committed by Kirill Yukhin
Browse files

github-ci: add link to log in Telegram message

The link to the failed job log is not saved in other GitHub Actions
links. At the same time this link can be obtained via the following
command using GitHub API:

 $ curl -s https://api.github.com/repos/tarantool/tarantool/actions/runs/${{  github.run_id }}/jobs | jq -r '.jobs[0].html_url'

The obtained link for the particular run has the following format:
https://github.com/tarantool/tarantool/runs/<id>, where 'id' is the
number of the job.

This link is added to the Telegram message for the failed job which ID
is set as suggested in GitHub docs[1].

[1]: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#example-6
parent 9044a1ba
No related branches found
No related tags found
No related merge requests found
......@@ -22,10 +22,18 @@ runs:
fi
echo BRANCH_NAME=$branch_name | tee -a $GITHUB_ENV
shell: bash
# get job id number
- run: |
apt update && apt install -y jq
echo 'JOB_ID<<EOF' >> $GITHUB_ENV
curl -s https://api.github.com/repos/tarantool/tarantool/actions/runs/${{ github.run_id }}/jobs | jq -r '.jobs[0].id' | tee -a $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
shell: bash
- env:
MSG: |
🔴 Workflow testing failed:
Job: [ `${{ github.job }}`](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
Log: [ `#${{ env.JOB_ID }}`](https://github.com/${{ github.repository }}/runs/${{ env.JOB_ID }})
Commit: [ `${{ github.sha }}`](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
Branch: [ `${{ env.BRANCH_NAME }}`](https://github.com/${{ github.repository }}/tree/${{ env.BRANCH_NAME }})
History: [commits](https://github.com/${{ github.repository }}/commits/${{ github.sha }})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment