Skip to content

Commit 10b3ab8

Browse files
committed
Add concurrency workflows to cancel in-progress jobs and update README with new badges
1 parent 9aa57b9 commit 10b3ab8

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Cancel_InProgress
2+
run-name: Cancel In Progress Workflow
3+
description: "This workflow cancels in-progress jobs when a new run is triggered."
4+
5+
on:
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
cancel_in_progress_job:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel In Progress Jobs
17+
run: echo "This job will cancel in-progress jobs for the same workflow and branch."
18+
19+
20+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Cancel_InProgress_Jobs
2+
run-name: Cancel In Progress Jobs
3+
description: "This workflow cancels in-progress jobs when a new run is triggered."
4+
5+
on:
6+
workflow_dispatch:
7+
8+
jobs:
9+
cancel_in_progress_job:
10+
runs-on: ubuntu-latest
11+
concurrency:
12+
group: example-group
13+
cancel-in-progress: true

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@
3434

3535
[![Fail_Job_By_Non_Zero](https://github.com/Albejr/github-workflow-learn/actions/workflows/11-0-action-fail.yaml/badge.svg?branch=main)](https://github.com/Albejr/github-workflow-learn/actions/workflows/11-0-action-fail.yaml)
3636

37-
[![Using_Matrix](https://github.com/Albejr/github-workflow-learn/actions/workflows/12-0-matrix.yaml/badge.svg?branch=main)](https://github.com/Albejr/github-workflow-learn/actions/workflows/12-0-matrix.yaml)
37+
[![Using_Matrix](https://github.com/Albejr/github-workflow-learn/actions/workflows/12-0-matrix.yaml/badge.svg?branch=main)](https://github.com/Albejr/github-workflow-learn/actions/workflows/12-0-matrix.yaml)
38+
39+
[![Cancel_InProgress](https://github.com/Albejr/github-workflow-learn/actions/workflows/13-0-concurrency.yaml/badge.svg?branch=main)](https://github.com/Albejr/github-workflow-learn/actions/workflows/13-0-concurrency.yaml)
40+
41+
[![Cancel_InProgress_Jobs](https://github.com/Albejr/github-workflow-learn/actions/workflows/13-1-jobs-concurrency.yaml/badge.svg?branch=main)](https://github.com/Albejr/github-workflow-learn/actions/workflows/13-1-jobs-concurrency.yaml)

0 commit comments

Comments
 (0)