Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
🐛 Use last completed workflow, not this one
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Dec 8, 2020
1 parent 7d332a3 commit b2899a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const run = async () => {
const [owner, repo] = (process.env.GITHUB_REPOSITORY || "").split("/");
const octokit = getOctokit(token);

const runs = await octokit.actions.listWorkflowRunsForRepo({ owner, repo });
const runs = await octokit.actions.listWorkflowRunsForRepo({ owner, repo, status: "completed" });
const lastRun = runs.data.workflow_runs.find((run) => run.workflow_id === 4116102);
let lastDate = new Date("1970-01-01");
if (lastRun) lastDate = new Date(lastRun.created_at);
Expand Down

0 comments on commit b2899a6

Please sign in to comment.