Last active
October 11, 2021 23:33
-
-
Save dllopis-sfdc/94a4b3be12f5f2e8ea42e9a382aee800 to your computer and use it in GitHub Desktop.
How to archive / unarchive a repository with GitHub CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REPO_NAME=condition-jenkins | |
REPO_ID=$(gh api graphql -q '.data.repository.id' -f query="query {repository(owner: \"krux\", name: \"${REPO_NAME}\") {id}}") | |
# unarchive: | |
gh api graphql --silent -f query="mutation {archiveRepository(input: {repositoryId: \"${REPO_ID}\"}){clientMutationId}}" | |
# archive | |
gh api graphql --silent -f query="mutation {unarchiveRepository(input: {repositoryId: \"${REPO_ID}\"}){clientMutationId}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment