From 3b7e3bd50fc212ee1b9e1d39b00b665aeba60da0 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 13 Jan 2023 13:11:22 -0500 Subject: [PATCH] chore(docs): document the native behavior (#201) So long, and thanks for all the fish[1](https://en.wikipedia.org/wiki/So_Long,_and_Thanks_for_All_the_Fish) - Related to #200 - Closes #191 - Closes #76 --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 435a11c7..211a92f0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +> **Warning** +> In April 2021, GitHub [announced](https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/) native support for canceling workflows. +> +> You probably don't need this custom action. Instead, use the native behavior by adding this to your workflow yaml: +> ``` +> concurrency: +> group: ${{ github.workflow }}-${{ github.ref }} +> cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +> ``` +> Read the [official documentation](https://docs.github.com/en/actions/using-jobs/using-concurrency) to learn more. + # Cancel Workflow Action This is a GitHub Action that will cancel any previous runs that are not `completed` for a given workflow.