Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dllopis-sfdc
dllopis-sfdc / gh_cli_archive_unarchive_repository.bash
Last active October 11, 2021 23:33
How to archive / unarchive a repository with GitHub CLI
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}}"

Keybase proof

I hereby claim:

  • I am dllopis-sfdc on github.
  • I am sfdc_dll (https://keybase.io/sfdc_dll) on keybase.
  • I have a public key ASBtARdpvI23ndevkH7R0oTwRDxdZYztzB0D3S_udvcUcQo

To claim this, I am signing this object: