Skip to content

Commit f00b7ee

Browse files
authored
Consistent usage of term 'workflow run' (#266)
1 parent efe447d commit f00b7ee

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22

33
`skip-duplicate-actions` provides the following features to optimize GitHub Actions:
44

5-
- [Skip duplicate workflow-runs](#skip-duplicate-workflow-runs) after merges, pull requests or similar.
6-
- [Skip concurrent or parallel workflow-runs](#skip-concurrent-workflow-runs) for things that you do not want to run twice.
5+
- [Skip duplicate workflow runs](#skip-duplicate-workflow-runs) after merges, pull requests or similar.
6+
- [Skip concurrent or parallel workflow runs](#skip-concurrent-workflow-runs) for things that you do not want to run twice.
77
- [Skip ignored paths](#skip-ignored-paths) to speedup documentation-changes or similar.
88
- [Skip if paths not changed](#skip-if-paths-not-changed) for something like directory-specific tests.
9-
- [Cancel outdated workflow-runs](#cancel-outdated-workflow-runs) after branch-pushes.
9+
- [Cancel outdated workflow runs](#cancel-outdated-workflow-runs) after branch-pushes.
1010

1111
All of those features help to save time and costs; especially for long-running workflows.
1212
You can choose any subset of those features.
1313

14-
## Skip duplicate workflow-runs
14+
## Skip duplicate workflow runs
1515

16-
If you work with feature branches, then you might see lots of _duplicate workflow-runs_.
17-
For example, duplicate workflow-runs can happen if a workflow runs on a feature branch, but then the workflow is repeated right after merging the feature branch.
16+
If you work with feature branches, then you might see lots of _duplicate workflow runs_.
17+
For example, duplicate workflow runs can happen if a workflow run is performed on a feature branch, but then the workflow run is repeated right after merging the feature branch.
1818
`skip-duplicate-actions` allows to prevent such runs.
1919

2020
- **Full traceability:** After clean merges, you will see a message like `Skip execution because the exact same files have been successfully checked in <previous_run_URL>`.
2121
- **Fully configurable:** By default, manual triggers and cron will never be skipped.
2222
- **Flexible Git usage:** `skip-duplicate-actions` does not care whether you use fast-forward-merges, rebase-merges or squash-merges.
23-
However, if a merge yields a result that is different from the source branch, then the resulting workflow-run will _not_ be skipped.
23+
However, if a merge yields a result that is different from the source branch, then the resulting workflow run will _not_ be skipped.
2424
This is commonly the case if you merge "outdated branches".
2525

26-
## Skip concurrent workflow-runs
26+
## Skip concurrent workflow runs
2727

2828
Sometimes, there are workflows that you do not want to run twice at the same time even if they are triggered twice.
29-
Therefore, `skip-duplicate-actions` provides the following options to skip a workflow-run if the same workflow is already running:
29+
Therefore, `skip-duplicate-actions` provides the following options to skip a workflow run if the same workflow is already running:
3030

3131
- **Always skip:** This is useful if you have a workflow that you never want to run twice at the same time.
3232
- **Only skip same content:** For example, this can be useful if a workflow has both a `push` and a `pull_request` trigger, or if you push a tag right after pushing a commit.
33-
(*Deprecated*, use `same_content_newer` instead)
33+
(_Deprecated_, use `same_content_newer` instead)
3434
- **Only skip newer runs with the same content:** If the same workflow is running on the exact same content, skip newer runs of it. `same_content_newer` ensures that at least one of those workflows will run, while `same_content` may skip all of them.
3535
- **Only skip outdated runs:** For example, this can be useful for skip-checks that are not at the beginning of a job.
3636
- **Never skip:** This disables the concurrent skipping functionality, but still lets you use all other options like duplicate skipping.
@@ -64,12 +64,12 @@ Instead of blindly skipping checks, the backtracking-algorithm will only skip so
6464

6565
You can use the [`paths_filter`](#paths_filter) option if you need to define multiple `paths` patterns in a single workflow.
6666

67-
## Cancel outdated workflow-runs
67+
## Cancel outdated workflow runs
6868

6969
Typically, workflows should only run for the most recent commit.
70-
Therefore, when you push changes to a branch, `skip-duplicate-actions` can be configured to cancel any previous workflow-runs that run against outdated commits.
70+
Therefore, when you push changes to a branch, `skip-duplicate-actions` can be configured to cancel any previous workflow runs that run against outdated commits.
7171

72-
- **Full traceability:** If a workflow-run is cancelled, then you will see a message like `Cancelled <previous_run_URL>`.
72+
- **Full traceability:** If a workflow run is cancelled, then you will see a message like `Cancelled <previous_run_URL>`.
7373
- **Guaranteed execution:** The cancellation-algorithm guarantees that a complete check-set will finish no matter what.
7474

7575
## Inputs
@@ -121,7 +121,7 @@ See the corresponding [`paths_result`](#paths_result) output and [example config
121121

122122
### `cancel_others`
123123

124-
If true, then workflow-runs from outdated commits will be cancelled.
124+
If true, then workflow runs from outdated commits will be cancelled.
125125

126126
**Default:** `'false'`
127127

@@ -141,7 +141,7 @@ Possible values are `pull_request`, `push`, `workflow_dispatch`, `schedule`.
141141

142142
### `concurrent_skipping`
143143

144-
Skip a workflow-run if the same workflow is already running.
144+
Skip a workflow run if the same workflow is already running.
145145

146146
One of `never`, `same_content`, `same_content_newer`, `outdated_runs`, `always`.
147147

@@ -334,12 +334,12 @@ jobs:
334334

335335
## How does it work?
336336

337-
`skip-duplicate-actions` uses the [Workflow Runs API](https://docs.github.com/en/rest/reference/actions#workflow-runs) to query workflow-runs.
338-
`skip-duplicate-actions` will only look at workflow-runs that belong to the same workflow as the current workflow-run.
339-
After querying such workflow-runs, it will compare them with the current workflow-run as follows:
337+
`skip-duplicate-actions` uses the [Workflow Runs API](https://docs.github.com/en/rest/reference/actions#workflow-runs) to query workflow runs.
338+
`skip-duplicate-actions` will only look at workflow runs that belong to the same workflow as the current workflow run.
339+
After querying such workflow runs, it will compare them with the current workflow run as follows:
340340

341-
- If there exists a workflow-runs with the same tree hash, then we have identified a duplicate workflow-run.
342-
- If there exists an in-progress workflow-run, then we can cancel it or skip, depending on your configuration.
341+
- If there exists a workflow run with the same tree hash, then we have identified a duplicate workflow run.
342+
- If there exists an in-progress workflow run, then we can cancel it or skip, depending on your configuration.
343343

344344
## How does path-skipping work?
345345

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Skip Duplicate Actions'
2-
description: 'Skip duplicate workflow-runs. Skip or ignore specific paths. Cancel outdated workflow-runs.'
2+
description: 'Skip duplicate workflow runs. Skip or ignore specific paths. Cancel outdated workflow runs.'
33
author: 'fkirc'
44
branding:
55
icon: 'stop-circle'
@@ -21,7 +21,7 @@ inputs:
2121
description: 'A YAML-string with named paths_ignore/paths patterns'
2222
required: false
2323
cancel_others:
24-
description: 'If true, then workflow-runs from outdated commits will be cancelled'
24+
description: 'If true, then workflow runs from outdated commits will be cancelled'
2525
required: false
2626
default: 'false'
2727
skip_after_successful_duplicate:

dist/index.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function parseWorkflowRun(run: ActionsGetWorkflowRunResponseData): WorkflowRun {
9191
}
9292
const workflowId = run.workflow_id
9393
if (!workflowId) {
94-
logFatal(`Could not find the workflow id of run ${run.id}`)
94+
logFatal(`Could not find the workflow ID of run ${run.id}`)
9595
}
9696
return {
9797
event: run.event as WRunTrigger,
@@ -122,7 +122,7 @@ function parseOlderRuns(
122122
currentRun: WorkflowRun
123123
): WorkflowRun[] {
124124
const olderRuns = response.workflow_runs.filter(run => {
125-
// Only consider older workflow-runs to prevent some nasty race conditions and edge cases.
125+
// Only consider older workflow runs to prevent some nasty race conditions and edge cases.
126126
return (
127127
new Date(run.created_at).getTime() <
128128
new Date(currentRun.createdAt).getTime()
@@ -214,7 +214,7 @@ async function main(): Promise<void> {
214214
const successfulDuplicateRun = detectSuccessfulDuplicateRuns(context)
215215
if (successfulDuplicateRun) {
216216
core.info(
217-
`Skip execution because the exact same files have been successfully checked in ${successfulDuplicateRun.html_url}`
217+
`Skip execution because the exact same files have been successfully checked in run ${successfulDuplicateRun.html_url}`
218218
)
219219
exitSuccess({
220220
shouldSkip: true,
@@ -278,7 +278,7 @@ async function cancelOutdatedRuns(context: WRunContext): Promise<void> {
278278
)
279279
})
280280
if (!cancelVictims.length) {
281-
return core.info('Did not find other workflow-runs to be cancelled')
281+
return core.info('Did not find other workflow runs to be cancelled')
282282
}
283283
for (const victim of cancelVictims) {
284284
await cancelWorkflowRun(victim, context)
@@ -295,7 +295,7 @@ async function cancelWorkflowRun(
295295
repo: context.repoName,
296296
run_id: run.runId
297297
})
298-
core.info(`Cancelled ${run.html_url} with response code ${res.status}`)
298+
core.info(`Cancelled run ${run.html_url} with response code ${res.status}`)
299299
} catch (e) {
300300
if (e instanceof Error || typeof e === 'string') {
301301
core.warning(e)
@@ -328,7 +328,7 @@ function detectConcurrentRuns(context: WRunContext): WorkflowRun | undefined {
328328
})
329329

330330
if (!concurrentRuns.length) {
331-
core.info(`Did not find any concurrent workflow-runs`)
331+
core.info(`Did not find any concurrent workflow runs`)
332332
return
333333
}
334334
if (context.concurrentSkipping === 'always') {
@@ -354,7 +354,7 @@ function detectConcurrentRuns(context: WRunContext): WorkflowRun | undefined {
354354
)
355355
if (concurrentDuplicate) {
356356
core.info(
357-
`Skip execution because the exact same files are concurrently checked in ${concurrentDuplicate.html_url}`
357+
`Skip execution because the exact same files are concurrently checked in run ${concurrentDuplicate.html_url}`
358358
)
359359
return concurrentDuplicate
360360
}
@@ -366,12 +366,12 @@ function detectConcurrentRuns(context: WRunContext): WorkflowRun | undefined {
366366
)
367367
if (concurrentIsOlder) {
368368
core.info(
369-
`Skip execution because the exact same files are concurrently checked in older ${concurrentIsOlder.html_url}`
369+
`Skip execution because the exact same files are concurrently checked in older run ${concurrentIsOlder.html_url}`
370370
)
371371
return concurrentIsOlder
372372
}
373373
}
374-
core.info(`Did not find any concurrent workflow-runs that justify skipping`)
374+
core.info(`Did not find any concurrent workflow runs that justify skipping`)
375375
}
376376

377377
async function backtracePathSkipping(
@@ -475,7 +475,7 @@ async function backtracePathSkipping(
475475
// Should be never reached in practice; we expect that this loop aborts after 1-3 iterations.
476476
if (distanceToHEAD++ >= 50) {
477477
core.warning(
478-
'Aborted commit-backtracing due to bad performance - Did you push an excessive number of ignored-path-commits?'
478+
'Aborted commit-backtracing due to bad performance - Did you push an excessive number of ignored-path commits?'
479479
)
480480
break
481481
}

0 commit comments

Comments
 (0)