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

Failing to remove inactive deployments #18

Closed
KD-7 opened this issue Feb 12, 2023 · 1 comment
Closed

Failing to remove inactive deployments #18

KD-7 opened this issue Feb 12, 2023 · 1 comment
Labels
Help wanted Extra attention is needed

Comments

@KD-7
Copy link
Contributor

KD-7 commented Feb 12, 2023

I am trying to remove the inactive deployments when I had previously deployed to github-pages.
See:

  1. https://docs.github.com/en/rest/deployments/deployments?apiVersion=2022-11-28
  2. https://docs.github.com/en/rest/deployments/deployments?apiVersion=2022-11-28#delete-a-deployment

(Note I have gh installed)

By first running via the GitHub CLI api

gh api \
  -H "Accept: application/vnd.github+json" \
  /repos/comp0016-group1/truelearn/deployments

To list out the deployment IDs then:

gh api \
  --method DELETE \
  -H "Accept: application/vnd.github+json" \
  /repos/comp0016-group1/truelearn/deployments/DEPLOYMENT_ID

But I get back the message:

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest"
}
gh: Not Found (HTTP 404)
@KD-7 KD-7 added the Help wanted Extra attention is needed label Feb 13, 2023
@KD-7
Copy link
Contributor Author

KD-7 commented Feb 15, 2023

The reason why, is that I did not have organisation permission to do this. Hence I had to create a github app with organisation perms, to then generate a token which I used in a workflow to delete these deployments.
Related info:
tschaub/gh-pages#351

@KD-7 KD-7 closed this as completed Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant