Skip to content

Commit

Permalink
Merge pull request #12297 from goanpeca/fix/merge-cancels
Browse files Browse the repository at this point in the history
PR: Only cancel previous builds on pull_request events
  • Loading branch information
ccordoba12 committed Apr 12, 2020
2 parents 65ee504 + e79014e commit 0bb255f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/check_skip_py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ HEAD_REF=$(git rev-parse HEAD)
echo "base: $BASE_REF"
echo "head: $HEAD_REF"
FILES=$(git diff --name-only $BASE_REF $HEAD_REF)
COUNT=$(echo $FILES | grep -c ".*\.py.*")
COUNT=$(echo $FILES | grep -c ".*\.py.*\|.*MANIFEST\.in.*\|.*\.sh.*\|.*\.bat.*\|.*\.yml.*\|.*\conda.txt.*\|.*tests.txt.*")

echo "Files including the filter: $FILES"
echo "Py files filter count: $COUNT"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
cleanup-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- run: echo $GITHUB_EVENT_NAME
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Py${{ matrix.PYTHON_VERSION }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
cleanup-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- run: echo $GITHUB_EVENT_NAME
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
cleanup-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- run: echo $GITHUB_EVENT_NAME
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
cleanup-previous-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- run: echo $GITHUB_EVENT_NAME
- uses: rokroskar/workflow-run-cleanup-action@v0.2.2
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
Expand Down

0 comments on commit 0bb255f

Please sign in to comment.