Skip to content

Commit ac0c340

Browse files
adding several gh cli commands
1 parent 7e0cc9c commit ac0c340

9 files changed

+56
-0
lines changed

gh-cli/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,42 @@ $ echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
2626

2727
See the [docs](https://cli.github.com/manual/gh_auth_login) for further information.
2828

29+
## delete-release.sh
30+
31+
Deletes a release from a repository - need the [ID](#get-releasessh) of the release
32+
33+
## delete-repo.sh
34+
35+
Deletes a repo - also works if the repository is locked from a failed migration, etc.
36+
2937
## enable-actions-on-repository.sh
3038

3139
Enable actions on repository - similar to [API example](./../api/enable-actions-on-repository.sh), but using `gh cli`
3240

41+
## get-actions-permissions-on-repository.sh
42+
43+
Gets the status of Actions on a repository (ie, if Actions are disabled)
44+
45+
## get-org-team-members.sh
46+
47+
Gets a list of members on a team
48+
49+
## get-org-team.sh
50+
51+
Gets a team
52+
53+
## get-releases.sh
54+
55+
Gets a list of releases for a repository
56+
57+
## get-repo.sh
58+
59+
Gets details about a repo
60+
61+
## get-repository-topics.sh
62+
63+
Gets a list of topics for a repository
64+
3365
## sso-credential-authorizations.sh
3466

3567
Retrieves a list of users who have SSO-enabled personal access tokens in an organization.

gh-cli/delete-release.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api --method DELETE /repos/joshjohanning-org/test-workflow-artifacts/releases/63172485

gh-cli/delete-repo.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api --method DELETE /repos/joshjohanning-org/hello-world
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api -X GET /repos/joshjohanning-ghas-enablement/MyShuttle/actions/permissions

gh-cli/get-org-team-members.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api --paginate /orgs/joshjohanning-org/teams/approver-team/members --jq='.[] | [.login] | join(",")' # the join removes the "[" and "]" from the results

gh-cli/get-org-team.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api /orgs/joshjohanning-org/teams/test

gh-cli/get-releases.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api --method GET /repos/joshjohanning/approveops/releases

gh-cli/get-repo.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api --method GET /repos/joshjohanning-org/mermaid

gh-cli/get-repository-topics.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api /repos/joshjohanning-org/test-workflow-artifacts/topics --jq='.names'

0 commit comments

Comments
 (0)