Get deployment id in GitHub Action

Hi there. I’m currently using GitHub Deployments by setting the environment like so:

    runs-on: ubuntu-latest

    # deploy to the review environment
      name: review

GitHub will automatically create the deployment and update the deployment status, so I don’t need to call any api’s. This works great.

The problem I have is I need to delete the deployment when, for example, a pull request is closed. And to do that I need the deployment id.

How can I get the deployment id? I’ve inspected all of the context available and can’t find any reference to the deployment id.

1 Like

Hopefully we can work out on a feature soon to address this, this was discussed.

There is no deployment Id that’s available from context unfortunately.

May be Repositories - GitHub Docs can be used to workaround that.

1 Like