Skip to content
This repository was archived by the owner on May 15, 2021. It is now read-only.

Commit 7d35aba

Browse files
feat: build for release
1 parent 15f7001 commit 7d35aba

39 files changed

+214
-14944
lines changed

README.ja.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Auto Cancel Redundant Workflow
22

3+
---
4+
5+
**Please note:** This repository is currently unmaintained by a team of developers at GitHub. The
6+
repository is here and you can use it as an example, or in Actions. However please be aware that
7+
we are not going to be updating issues or pull requests on this repository.
8+
9+
**注意:** このリポジトリはもうメンテナンスされません。
10+
代わりに公式から提供されている [concurrency](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency) を使用してください。
11+
12+
### 移行例
13+
14+
```yaml
15+
on: push
16+
jobs:
17+
test:
18+
steps:
19+
- uses: technote-space/auto-cancel-redundant-workflow@v1
20+
- run: echo step1
21+
- run: echo step2
22+
# ...
23+
```
24+
25+
26+
27+
```yaml
28+
on: push
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.ref }}
31+
# cancel-in-progress: true
32+
jobs:
33+
test:
34+
steps:
35+
- run: echo step1
36+
- run: echo step2
37+
# ...
38+
```
39+
40+
---
41+
342
[![CI Status](https://github.com/technote-space/auto-cancel-redundant-workflow/workflows/CI/badge.svg)](https://github.com/technote-space/auto-cancel-redundant-workflow/actions)
443
[![codecov](https://codecov.io/gh/technote-space/auto-cancel-redundant-workflow/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/auto-cancel-redundant-workflow)
544
[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/auto-cancel-redundant-workflow/badge)](https://www.codefactor.io/repository/github/technote-space/auto-cancel-redundant-workflow)

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Auto Cancel Redundant Workflow
22

3+
---
4+
5+
**Please note:** This repository is no longer maintained.
6+
Please use the [concurrency](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency) provided by the officials instead.
7+
8+
### Example of migration
9+
10+
```yaml
11+
on: push
12+
jobs:
13+
test:
14+
steps:
15+
- uses: technote-space/auto-cancel-redundant-workflow@v1
16+
- run: echo step1
17+
- run: echo step2
18+
# ...
19+
```
20+
21+
22+
23+
```yaml
24+
on: push
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
# cancel-in-progress: true
28+
jobs:
29+
test:
30+
steps:
31+
- run: echo step1
32+
- run: echo step2
33+
# ...
34+
```
35+
36+
---
37+
338
[![CI Status](https://github.com/technote-space/auto-cancel-redundant-workflow/workflows/CI/badge.svg)](https://github.com/technote-space/auto-cancel-redundant-workflow/actions)
439
[![codecov](https://codecov.io/gh/technote-space/auto-cancel-redundant-workflow/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/auto-cancel-redundant-workflow)
540
[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/auto-cancel-redundant-workflow/badge)](https://www.codefactor.io/repository/github/technote-space/auto-cancel-redundant-workflow)

build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"owner":"technote-space","repo":"auto-cancel-redundant-workflow","sha":"edd1ba176a74ef268f90a3447d1522cffb9c2b47","ref":"refs/tags/test/v1.7.5.824911921","tagName":"test/v1.7.5.824911921","branch":"gh-actions","tags":["test/v1.7.5.824911921","test/v1.7.5","test/v1.7","test/v1"],"updated_at":"2021-05-09T09:04:41.761Z"}
1+
{"owner":"technote-space","repo":"auto-cancel-redundant-workflow","sha":"c89c89c33ee20adf2b472027a3918515338e0b9e","ref":"refs/tags/v1.7.5","tagName":"v1.7.5","branch":"gh-actions","tags":["v1.7.5","v1.7","v1"],"updated_at":"2021-05-15T07:07:19.051Z"}

lib/utils/workflow.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports.cancelWorkflowRun = exports.getWorkflowRuns = exports.getWorkflowRunNumb
44
const github_action_helper_1 = require("@technote-space/github-action-helper");
55
const misc_1 = require("./misc");
66
const getWorkflowRun = async (runId, octokit, context) => {
7-
return (await octokit.actions.getWorkflowRun({
7+
return (await octokit.rest.actions.getWorkflowRun({
88
owner: context.repo.owner,
99
repo: context.repo.repo,
1010
'run_id': runId,
@@ -37,15 +37,15 @@ const getWorkflowRuns = async (workflowId, logger, octokit, context) => {
3737
logger.log('target branch: %s', logger.c(branch, { color: 'green' }));
3838
options.branch = branch;
3939
}
40-
return (await octokit.paginate(octokit.actions.listWorkflowRuns,
40+
return (await octokit.paginate(octokit.rest.actions.listWorkflowRuns,
4141
// eslint-disable-next-line no-warning-comments
4242
// TODO: remove ts-ignore after fixed types (https://github.com/octokit/types.ts/issues/122)
4343
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
4444
// @ts-ignore
4545
options)).map(run => run).filter(run => run.event === context.eventName).filter(misc_1.isNotExcludeRun);
4646
};
4747
exports.getWorkflowRuns = getWorkflowRuns;
48-
const cancelWorkflowRun = async (runId, octokit, context) => octokit.actions.cancelWorkflowRun({
48+
const cancelWorkflowRun = async (runId, octokit, context) => octokit.rest.actions.cancelWorkflowRun({
4949
...context.repo,
5050
'run_id': runId,
5151
});

0 commit comments

Comments
 (0)