Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid auto-inactivating GitHub Actions deployments
The GitHub REST API docs for deployments say, "When you set the state of a deployment to `success`, then all prior non-transient, non-production environment deployments in the same repository with the same environment name will become `inactive`. To avoid this, you can set `auto_inactive` to `false` when creating the deployment status." GitHub Actions auto-inactivates deployments. When a deployment environment is used from within a GitHub Actions workflow job with the `environment:` configuration syntax, GitHub Actions marks previous deployments to that environment as `inactive`. This behavior is undocumented and there doesn't appear to be a way to configure it, but there are some possible workarounds/hacks. One workaround could be using the GitHub deployment statuses API to reactivate deployments of interest. https://docs.github.com/en/rest/deployments/statuses?apiVersion=2022-11-28 Another workaround for keeping deployments active could be through deployment URLs. A GitHub community discussion comment hints, "If the new Deployment specifies an environment URL in the workflow definition, only previous Deployments with the exact same environment URL will be auto-inactivated." This implies that deployments could stay active if each deployment got its own unique URL. https://github.com/orgs/community/discussions/67982#discussioncomment-7086962 Commit 6e532c6 configured Python package publication to use PyPI OIDC with GitHub Actions deployment environments. This commit will update the GitHub Actions workflow so that each deployment has its own unique URL.
- Loading branch information