3b1b / 3Blue1Brown.com

https://www.3blue1brown.com
Other
345 stars 124 forks source link

Sync action race condition #402

Open kurtbruns opened 5 months ago

kurtbruns commented 5 months ago

If multiple commits are made to main in quick succession that have different assets, then the last one to finish is going to reflect the state the bucket is left in. This is a problem because we only want the last commit's run and the run time of a workflow seems to vary between 1-4 mins. I think the solution is to use something like: https://github.com/styfle/cancel-workflow-action

The workflows/sync-assets.yaml file would be modified to have the cancel job before the other job that either clears out all workflows or specifically the sync workflow.

jobs:
  cancel:
    runs-on: ubuntu-latest
    steps:
      - name: Cancel Previous Runs
        uses: styfle/cancel-workflow-action
vincerubinetti commented 1 month ago

Would the built in concurrency option be enough here?

kurtbruns commented 1 month ago

At a glance, the concurrency option looks like it will work if you also specify cancel-in-progress: true