-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add show-waiting-runner option (#148)
- Loading branch information
Showing
13 changed files
with
1,314 additions
and
979 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 |
---|---|---|
|
@@ -22,6 +22,9 @@ jobs: | |
# e.g.: ${{ secrets.MY_PAT }} | ||
# Default: ${{ github.token }} | ||
github-token: '' | ||
# Show waiting runner time in the timeline. | ||
# Default: true | ||
show-waiting-runner: true | ||
|
||
# Your build steps... | ||
``` | ||
|
@@ -88,7 +91,7 @@ GET `workflow_job` API response does not contain `created_at` field in | |
it is added from | ||
[GHES v3.9](https://docs.github.com/en/[email protected]/rest/actions/workflow-jobs?apiVersion=2022-11-28). | ||
So it is not possible to calculate the elapsed time the runner is waiting for a | ||
job, `actions-timeline` inserts a dummy step instead. | ||
job, `actions-timeline` omits `Waiting for a runner` step in the timeline. | ||
|
||
# Similar works | ||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import { setTimeout } from "node:timers/promises"; | ||
import process from "node:process"; | ||
import { debug, getInput, info, summary } from "npm:@actions/[email protected]"; | ||
import { | ||
debug, | ||
getBooleanInput, | ||
getInput, | ||
info, | ||
summary, | ||
} from "npm:@actions/[email protected]"; | ||
import * as github from "npm:@actions/[email protected]"; | ||
import { createMermaid } from "./workflow_gantt.ts"; | ||
import { | ||
|
@@ -11,6 +17,7 @@ import { | |
|
||
const main = async () => { | ||
const token = getInput("github-token", { required: true }); | ||
const showWaitingRunner = getBooleanInput("show-waiting-runner"); | ||
const octokit = createOctokitForAction(token); | ||
|
||
info("Wait for workflow API result stability..."); | ||
|
@@ -41,7 +48,7 @@ const main = async () => { | |
debug(JSON.stringify(workflowJobs, null, 2)); | ||
|
||
info("Create gantt mermaid diagram..."); | ||
const gantt = createMermaid(workflow, workflowJobs); | ||
const gantt = createMermaid(workflow, workflowJobs, { showWaitingRunner }); | ||
await summary.addRaw(gantt).write(); | ||
debug(gantt); | ||
|
||
|
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
Oops, something went wrong.