Github
github
GitHub Adapter — interact with GitHub via gh CLI.
Provides repository creation, secret management, and Pages setup using the GitHub CLI (gh) for authentication and operations.
GitHubAdapter
Adapter for GitHub operations via gh CLI.
All operations require gh to be installed and authenticated.
Source code in packages/axm-init/src/axm_init/adapters/github.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
check_auth()
Check if user is authenticated with gh.
Returns:
| Type | Description |
|---|---|
bool
|
True if authenticated. |
Source code in packages/axm-init/src/axm_init/adapters/github.py
check_installed()
Check if gh CLI is installed.
Returns:
| Type | Description |
|---|---|
bool
|
True if gh is available. |
Source code in packages/axm-init/src/axm_init/adapters/github.py
create_repo(name, org=None, private=False, push_source=True)
Create a GitHub repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Repository name. |
required |
org
|
str | None
|
Organization (None for personal account). |
None
|
private
|
bool
|
Create as private repo. |
False
|
push_source
|
bool
|
Push current directory as source. |
True
|
Returns:
| Type | Description |
|---|---|
RepoCreateResult
|
RepoCreateResult with success status. |
Source code in packages/axm-init/src/axm_init/adapters/github.py
enable_pages(repo)
Enable GitHub Pages for a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
str
|
Repository in org/name format. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful. |
Source code in packages/axm-init/src/axm_init/adapters/github.py
set_secret(repo, name, value)
Set a repository secret.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repo
|
str
|
Repository in org/name format. |
required |
name
|
str
|
Secret name. |
required |
value
|
str
|
Secret value. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if successful. |