Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync action race condition #402

Open
kurtbruns opened this issue Jan 30, 2024 · 2 comments
Open

Sync action race condition #402

kurtbruns opened this issue Jan 30, 2024 · 2 comments

Comments

@kurtbruns
Copy link
Collaborator

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
Copy link
Collaborator

Would the built in concurrency option be enough here?

@kurtbruns
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants