Skip to content

Commit

Permalink
Use concurrency group to cancel workflows (#9540)
Browse files Browse the repository at this point in the history
* Use concurrency group to cancel workflows

* Remove needs
  • Loading branch information
HotThoughts authored Sep 6, 2021
1 parent 42edd05 commit 0efac92
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 51 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/cancel-stale-workflows.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/workflows/ci-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
pull_request:
types: [opened, synchronize, labeled]

concurrency:
group: ci-docs-tests-${{ github.ref }} # branch or tag name
cancel-in-progress: true

env:
DEFAULT_PYTHON_VERSION: '3.7'

Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/ci-model-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,17 @@ on:
pull_request:
types: [opened, synchronize, labeled]

concurrency:
group: ci-model-regression-${{ github.ref }} # branch or tag name
cancel-in-progress: true

env:
GKE_ZONE: us-central1
GCLOUD_VERSION: "318.0.0"

jobs:
cleanup_runs:
name: Cancel old branch builds
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

steps:
- name: Find and cancel old builds of this branch
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b #0.9.0
with:
access_token: "${{ secrets.GITHUB_TOKEN }}"
all_but_latest: true
ignore_sha: true

read_test_configuration:
name: Reads tests configuration
needs: cleanup_runs
if: "github.repository == 'RasaHQ/rasa' && contains(github.event.pull_request.labels.*.name, 'status:model-regression-tests')"
runs-on: ubuntu-latest
outputs:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- '*'
pull_request:

concurrency:
group: continous-integration-${{ github.ref }} # branch or tag name
cancel-in-progress: true

# SECRETS
# - GH_RELEASE_NOTES_TOKEN: personal access token of `rasabot` github account
# (login for account in 1pw)
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
tags:
- '**'

concurrency:
# group workflow runs based on the branch or the tag ref
group: documentation-${{ github.ref }}
cancel-in-progress: true

# SECRETS
# - GH_DOCS_WRITE_KEY: generated locally, added to github repo (public key)
# `ssh-keygen -t rsa -b 4096 -C "Github CI Docs Key" -N "" -f key`
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/security-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
types: [opened, synchronize, labeled]

concurrency:
group: security-scans-${{ github.head_ref }} # head branch name
cancel-in-progress: true

jobs:
changes:
name: Check for file changes
Expand All @@ -20,17 +24,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
filters: .github/change_filters.yml

cleanup_runs:
name: Cancel old branch builds
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

steps:
- name: Find and cancel old builds of this branch
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b
with:
access_token: "${{ secrets.GITHUB_TOKEN }}"

gitleaks:
name: Detecting hardcoded secrets
runs-on: ubuntu-latest
Expand Down

0 comments on commit 0efac92

Please sign in to comment.