turnstyle
turnstyle copied to clipboard
Clarification for abort-after-seconds
Hi, I wanted to clarify how this feature works. I tried to do abort-after-seconds: 1
hoping to bail right away if there is already a job in progress, but it seemed to wait much longer ~42 seconds before I canceled the job.
I then though that maybe it needs to work with poll-interval-seconds
, and also set that to 1
. This time the job resumed although there was already a run in progress so it should have stopped. Screenshot:
Similarly for the second run that I expected to fail:
Thank you!
This is the workflow:
name: release
on:
pull_request:
branches: [ master ]
jobs:
cancel-workflows:
runs-on: ubuntu-latest
steps:
- name: Block concurrent deploys
uses: softprops/turnstyle@v1
with:
abort-after-seconds: 1
poll-interval-seconds: 1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
another-job:
runs-on: ubuntu-latest
needs: [cancel-previous-workflows]
steps:
- name: sleep
run: sleep 30
Further testing seems like it only works when its on the same job like:
jobs:
cancel-workflows:
runs-on: ubuntu-latest
steps:
- name: Block concurrent deploys
uses: softprops/turnstyle@v1
with:
abort-after-seconds: 1
poll-interval-seconds: 1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: sleep
run: sleep 180
Not sure if that's intentional?