Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsManta committed Oct 19, 2023
1 parent 8a5a01f commit 4406a87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
11 changes: 6 additions & 5 deletions out/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -78023,15 +78023,16 @@ var mkdirp = Object.assign(async (path2, opts) => {
// src/post.ts
(async () => {
const api = github.getOctokit(core.getInput("github-token"));
console.log("job_id =", github.context.job);
const { data: job } = await api.rest.actions.getJobForWorkflowRun({
const { data: { jobs } } = await api.rest.actions.listJobsForWorkflowRun({
...github.context.repo,
job_id: Number(github.context.job)
run_id: github.context.runId
}).catch((error2) => {
core.error(error2);
return { data: { conclusion: null } };
return { data: { jobs: [] } };
});
if (job.conclusion === "success" || job.conclusion === "failure") {
const job = jobs.find((job2) => job2.name === github.context.job);
console.log("job =", job);
if (job?.conclusion === "success" || job?.conclusion === "failure") {
const result = {
status: job.conclusion,
url: `${github.context.serverUrl}/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.context.runId}/job/${github.context.job}`
Expand Down
12 changes: 7 additions & 5 deletions src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ void 0;
(async () => {
const api = github.getOctokit(core.getInput('github-token'))

console.log('job_id =', github.context.job)
const { data: job } = await api.rest.actions.getJobForWorkflowRun({
const { data: { jobs } } = await api.rest.actions.listJobsForWorkflowRun({
...github.context.repo,
job_id: Number(github.context.job),
run_id: github.context.runId,
}).catch((error) => {
core.error(error)

return { data: { conclusion: null } }
return { data: { jobs: [] } }
})

if (job.conclusion === 'success' || job.conclusion === 'failure') {
const job = jobs.find(job => job.name === github.context.job)
console.log('job =', job)

if (job?.conclusion === 'success' || job?.conclusion === 'failure') {
const result = {
status: job.conclusion,
url: `${github.context.serverUrl}/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.context.runId}/job/${github.context.job}`,
Expand Down

0 comments on commit 4406a87

Please sign in to comment.