-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get integration test status check from client repos (#973)
* Add step to get token * Send status checks back to spec PR * Remove comments, details * Regenerate client from commit 379360f of spec repo Co-authored-by: Hippolyte HENRY <hippolyte.henry@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
- Loading branch information
1 parent
c269a7a
commit 713b37b
Showing
3 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const SPEC_REPO = "datadog-api-spec" | ||
|
||
module.exports.post_status_check = async (github, context, status) => { | ||
const pr_num = context.payload.pull_request.head.ref.split("/")[2] | ||
const {data: pr} = await github.pulls.get({ | ||
owner: context.repo.owner, | ||
repo: SPEC_REPO, | ||
pull_number: pr_num, | ||
}); | ||
const { data: jobs } = await github.actions.listJobsForWorkflowRun({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: context.runId | ||
}); | ||
await github.repos.createCommitStatus({ | ||
owner: context.repo.owner, | ||
repo: SPEC_REPO, | ||
sha: pr.head.sha, | ||
state: status, | ||
target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${context.payload.pull_request.number}/checks?check_run_id=${jobs.jobs[0].id}`, | ||
description: `${context.repo.repo} integration tests`, | ||
context: `${context.repo.repo}_integration_tests` | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters