mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix the url of Cirrus failure notifications [ci skip]
The previous one was the url of this notification action, but we want to see a link to Cirrus CI. This code follows https://cirrus-ci.org/guide/notifications/. Also, head_branch was null only for pull requests from a fork, so we can use it for branch-based filtering, which is good.
This commit is contained in:
parent
c746f380f2
commit
a8e2d73628
1 changed files with 13 additions and 3 deletions
16
.github/workflows/cirrus-notify.yml
vendored
16
.github/workflows/cirrus-notify.yml
vendored
|
@ -10,23 +10,33 @@ jobs:
|
||||||
&& github.event.check_suite.conclusion != 'success'
|
&& github.event.check_suite.conclusion != 'success'
|
||||||
&& github.event.check_suite.conclusion != 'cancelled'
|
&& github.event.check_suite.conclusion != 'cancelled'
|
||||||
&& github.event.check_suite.conclusion != 'skipped'
|
&& github.event.check_suite.conclusion != 'skipped'
|
||||||
|
&& github.event.check_suite.head_branch == 'master'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: octokit/request-action@v2.x
|
||||||
|
id: get_failed_check_run
|
||||||
|
with:
|
||||||
|
route: GET /repos/${{ github.repository }}/check-suites/${{ github.event.check_suite.id }}/check-runs?status=completed
|
||||||
|
mediaType: '{"previews": ["antiope"]}'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
env:
|
env:
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
run: echo "$GITHUB_CONTEXT"
|
run: echo "$GITHUB_CONTEXT"
|
||||||
|
- name: Dump check_runs
|
||||||
|
env:
|
||||||
|
CHECK_RUNS: ${{ steps.get_failed_check_run.outputs.data }}
|
||||||
|
run: echo "$CHECK_RUNS"
|
||||||
- uses: ruby/action-slack@v3.0.0
|
- uses: ruby/action-slack@v3.0.0
|
||||||
with:
|
with:
|
||||||
payload: |
|
payload: |
|
||||||
{
|
{
|
||||||
"ci": "Cirrus CI",
|
"ci": "Cirrus CI",
|
||||||
"env": "Cirrus CI",
|
"env": "Cirrus CI",
|
||||||
"url": "https://github.com/ruby/ruby/actions/runs/${{ github.run_id }}",
|
"url": "${{ fromJson(steps.get_failed_check_run.outputs.data).check_runs[0].html_url }}",
|
||||||
"commit": "${{ github.event.check_suite.head_commit.id }}",
|
"commit": "${{ github.event.check_suite.head_commit.id }}",
|
||||||
"branch": "${{ github.event.check_suite.head_branch }}"
|
"branch": "${{ github.event.check_suite.head_branch }}"
|
||||||
}
|
}
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||||
# head_branch can be null. checking it here to see GITHUB_CONTEXT on master.
|
|
||||||
if: ${{ github.event.check_suite.head_branch == 'master' }}
|
|
||||||
|
|
Loading…
Reference in a new issue