Skip to content

Commit bd1fcf7

Browse files
updated readme
1 parent 611ba4c commit bd1fcf7

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ The below one is used to determine the owner of repo. This is a environment vari
1818
GITHUB_REPOSITORY_OWNER
1919
```
2020

21+
GH_APP_TOKEN --> This is GitHub App installation token generated by using action `https://github.com/marketplace/actions/create-a-github-app-installation-access-token`
22+
This token is used for all API calls.
23+
24+

create_repo_secrets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def create_or_update_repository_secret_github(repo_name: str, secret_name: str,
3434

3535
headers = {
3636
"Accept": "application/vnd.github+json",
37-
"Authorization": f"Bearer {os.getenv('GH_TOKEN')}",
37+
"Authorization": f"Bearer {os.getenv('GH_APP_TOKEN')}",
3838
"X-GitHub-Api-Version": "2022-11-28"
3939
}
4040
data = {

get_repo_public_key.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def get_repository_public_key(organization: str, repository_name: str):
2727
repository_public_key_url = f'https://api.github.com/repos/{organization}/{repository_name}/actions/secrets/public-key'
2828
headers = {
2929
"Accept": "application/vnd.github+json",
30-
"Authorization": f"Bearer {os.getenv('GH_TOKEN')}",
30+
"Authorization": f"Bearer {os.getenv('GH_APP_TOKEN')}",
3131
"X-GitHub-Api-Version": "2022-11-28"
3232
}
3333
response = requests.get(repository_public_key_url, headers=headers)
@@ -56,7 +56,7 @@ def get_repository_public_key_id(organization: str, repository_name: str):
5656
repository_public_key_id_url = f'https://api.github.com/repos/{organization}/{repository_name}/actions/secrets/public-key'
5757
headers = {
5858
"Accept": "application/vnd.github+json",
59-
"Authorization": f"Bearer {os.getenv('GH_TOKEN')}",
59+
"Authorization": f"Bearer {os.getenv('GH_APP_TOKEN')}",
6060
"X-GitHub-Api-Version": "2022-11-28"
6161
}
6262
response = requests.get(repository_public_key_id_url, headers=headers)

list_repos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def list_repos(search_string: str):
1616

1717
headers = {
1818
"Accept": "application/vnd.github+json",
19-
"Authorization": f"Bearer {os.getenv('GH_TOKEN')}",
19+
"Authorization": f"Bearer {os.getenv('GH_APP_TOKEN')}",
2020
"X-GitHub-Api-Version": "2022-11-28"
2121
}
2222

0 commit comments

Comments
 (0)