mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
Bugfix: Attach correct link to "levitate detect breaking changes"-message included in PR (#60220)
* Fixed so we link to the proper job and step. * Fixed according to feedback. * Added check_suite to the job link
This commit is contained in:
parent
f73cdc5e80
commit
d0a68b266c
@ -108,7 +108,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: ['buildPR', 'buildBase']
|
||||
env:
|
||||
GITHUB_STEP_NUMBER: 7
|
||||
GITHUB_STEP_NUMBER: 8
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@ -134,8 +134,9 @@ jobs:
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const name = 'Detect breaking changes';
|
||||
const script = require('./.github/workflows/scripts/pr-get-job-link.js')
|
||||
await script({github, context, core})
|
||||
await script({name, github, context, core})
|
||||
|
||||
- name: Detect breaking changes
|
||||
id: breaking-changes
|
||||
|
12
.github/workflows/scripts/pr-get-job-link.js
vendored
12
.github/workflows/scripts/pr-get-job-link.js
vendored
@ -1,9 +1,9 @@
|
||||
|
||||
module.exports = async ({ github, context, core }) => {
|
||||
module.exports = async ({ name, github, context, core }) => {
|
||||
const { owner, repo } = context.repo;
|
||||
const url = `https://api.github.com/repos/${owner}/${repo}/actions/runs/${context.runId}/jobs`
|
||||
const result = await github.request(url)
|
||||
const link = `https://github.com/grafana/grafana/runs/${result.data.jobs[0].id}?check_suite_focus=true`;
|
||||
|
||||
core.setOutput('link', link);
|
||||
}
|
||||
const result = await github.request(url);
|
||||
const job = result.jobs.find(j => j.name === name);
|
||||
|
||||
core.setOutput('link', `${job.html_url}?check_suite_focus=true`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user