There are times when you may need to cancel any currently running workflow within the same concurrency group. To do this, simply set cancel-in-progress: true.
1. Make sure you are still in the right project folder.
cd path/to/experiment-5-6-7
2. In the .github/workflows/main.yml file, add cancel-in-progress: true
setting for concurrency group.
|
|
3. Modify the README.md file with the following content.
echo "experiment 7: the first workflow execution!" > README.md
4. Make another commit and push to the remote repository.
git add . && git commit -m "experiment 7: the first workflow execution" && git push
5. On your remote repository, click the Actions tab, you should see that a workflow execution has been triggered.
6. On your local repository, update the README.md file with the following content.
echo "experiment 7: the second workflow execution!" > README.md
7. Make another commit and push to the remote repository.
git add . && git commit -m "experiment 7: the second workflow execution" && git push
8. On your remote repository, under the Actions tab, you may notice that the first workflow execution has been canceled, while the second workflow is now running.
Throughout the experiments, leveraging a concurrency group proves beneficial, allowing you to run a single workflow at a time. This is particularly useful for managing your account’s or organization’s resources, especially in situations where running multiple workflows simultaneously could lead to conflicts or unexpectedly high consumption of Actions minutes and storage.