-
Select Topic AreaQuestion BodyWe are using GitHub Actions for deploying updates. The deploy workflow is configured with: concurrency:
group: ${{ github.workflow }}-${{ github.ref }}This makes sure there's only ever one active deploy workflow run at a time. We do occasionally have deploys that fail due to transient issues, which can lead to situations like I've tried to illustrate here: sequenceDiagram
actor User
participant GitHub
participant Slack
User->>GitHub: Merges change A<br>Deploy workflow triggered
GitHub->>Slack: Deploy workflow fails, notification sent
User->>GitHub: Merges change B<br>Deploy workflow triggered
User-->>Slack: User notices notification about failed deploy
User->>GitHub: Schedules retry of deploy for change A,<br>It is added to the queue
Note over GitHub: Deploy for change B succeeds
Note over GitHub: Workflow for change A is run again, deploying an old commit
Is there a way to mark a workflow run as not allowed to be retried in case a later workflow run exists for the same workflow and branch? I can't see any options in the workflow syntax around this, so I guess an action potentially would need to be made to check this as the very first step in the workflow? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
|
Hey there, did you find a solution for this? I'm looking for the same. |
Beta Was this translation helpful? Give feedback.
-
|
This is also an issue for me. I'm using Git with Terraform and running an old action could cause the deletion of a lot of things even if done by mistake. I'm looking for workarounds within the pipeline, but it would be nice if we could mark actions as "stale" or disabled from running when a new commit pops up, or after some time. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
I think you should try disabling the workflow run |
Beta Was this translation helpful? Give feedback.
I spent a bit of time on it and have created an action that I think does what it needs: https://github.com/marketplace/actions/block-old-workflow-rerun.
I've done some testing myself, but please test it out and see if it works like you would want it to, and let me know if you spot any issues or need anything it doesn't do right now.