Skip to content

Commit

Permalink
pass in GH token
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Jan 20, 2025
1 parent 9c5ddb5 commit 18cb102
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test_call.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ env:
MAIL_PASSWORD: ${{secrets.MAIL_PASSWORD}}
BIOIMAGEIO_USER_ID: github|${{github.actor_id}}
GITHUB_ISSUE_NUMBER: ${{inputs.issue-nr}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
validate_format: # validate metadata in rdf.yaml
Expand Down
2 changes: 1 addition & 1 deletion bioimageio_collection_backoffice/_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Settings(BaseSettings, extra="ignore"):
s3_secret_access_key: SecretStr = SecretStr("")
zenodo_api_access_token: SecretStr = SecretStr("")
zenodo_test_api_access_token: SecretStr = SecretStr("")
github_pat: SecretStr = SecretStr("")
github_token: SecretStr = SecretStr("")


settings = Settings()
Expand Down
4 changes: 3 additions & 1 deletion bioimageio_collection_backoffice/gh_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

@cache
def get_gh_api():
return github.Github(auth=github.Auth.Token(settings.github_pat.get_secret_value()))
return github.Github(
auth=github.Auth.Token(settings.github_token.get_secret_value())
)


@cache
Expand Down
2 changes: 1 addition & 1 deletion scripts/reupload_old_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def upload_resources(


def workflow_dispatch(workflow_name: str, inputs: Dict[str, str]):
g = github.Github(login_or_token=os.environ["GITHUB_PAT"])
g = github.Github(login_or_token=os.environ["GITHUB_TOKEN"])

repo = g.get_repo("bioimage-io/collection")

Expand Down
2 changes: 1 addition & 1 deletion scripts/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def bioimageio_upload(resource_id: str, package_url: str):
g = github.Github(login_or_token=os.environ["GITHUB_PAT"])
g = github.Github(login_or_token=os.environ["GITHUB_TOKEN"])

repo = g.get_repo("bioimage-io/collection")

Expand Down

0 comments on commit 18cb102

Please sign in to comment.