Replies: 3 comments 3 replies
-
|
Hi @SSMG4, This is a known frustration with GitHub Actions deployments—sometimes a workflow gets “stuck” because GitHub thinks there’s a pending deployment, even when previous deployments show as completed. What’s likely happening: GitHub Actions keeps track of in-progress and pending deployments to prevent conflicts. Manually Cancel Stuck Deployments: |
Beta Was this translation helpful? Give feedback.
-
|
I understand how frustrating this must be - dealing with a deployment that says it's stuck even though it actually succeeded. This is a pretty common headache that many of us run into with GitHub Actions. The main reason this happens is that sometimes the workflow doesn't properly tell GitHub "Hey, I'm all done here!" so GitHub keeps showing the deployment as in progress even after it's finished. It's like when you finish a phone call but forget to hit the end button - the line stays open. A few things that usually help: First, check if there are any environment protection rules that might be waiting for approval that's already been given. Sometimes the system gets confused about whether an approval is still needed. You might also want to add a specific step in your workflow to explicitly mark the deployment as complete. Sometimes the automatic status updates don't work as expected. If it's a recurring issue, there's a way to add concurrency controls to prevent multiple deployments from overlapping and confusing each other. The good news is that since your deployment is actually working correctly, this is likely just a communication issue between your workflow and GitHub's UI rather than a problem with your actual deployment process. If you'd like to share your workflow file, I might be able to spot where the status reporting might be getting lost in translation. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @SSMG4, here's a workflow check that I use for similar persistent deployment state problems. This often resolves the persistent "phantom pending deployment" issue you're experiencing. Add Explicit Deployment Status Management- name: Start Deployment
uses: actions/github-script@v7
with:
script: |
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: '${{ steps.deployment.outputs.deployment_id }}',
state: 'in_progress'
});
# Your deployment steps here
- name: Mark Deployment Complete
if: success()
uses: actions/github-script@v7
with:
script: |
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: '${{ steps.deployment.outputs.deployment_id }}',
state: 'success'
});
- name: Mark Deployment Failed
if: failure()
uses: actions/github-script@v7
with:
script: |
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: '${{ steps.deployment.outputs.deployment_id }}',
state: 'failure'
});Documentation• [GitHub Deployment API](https://docs.github.com/en/rest/deployments/deployments) - Official deployment status management |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Bug
What GitHub Actions topic or product is this about?
Workflow Deployment
Discussion Details
So, this has been happening since basically the start of my repo, and i havent found any ways to fix it. When it happens it always says to cancel a specific deployment which when you go to see its details, it was deployed successfully before.



Beta Was this translation helpful? Give feedback.
All reactions