Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reading GitHub token from env var #236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 1.0.8
- Support providing GitHub Token via `APR_API_KEY` env var instead of `config.yaml`

## 1.0.7
- Add `--exclude-missing` when running `auto-pr status`
- Allows you to remove the `Missing PRs` section from the output
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ update_command:
- my-file
```

If you wish to keep your API Key outside of `config.yaml`, set the env var `APR_API_KEY` with your GitHub Token

### Repositories

You can define the list of repositories to pull and build into the database to update using a list of rules.
Expand Down
3 changes: 2 additions & 1 deletion autopr/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dataclasses import dataclass, field
from typing import List, Optional
from os import environ

import marshmallow_dataclass

Expand All @@ -17,8 +18,8 @@

@dataclass
class Credentials:
api_key: str
ssh_key_file: str
api_key: str = environ.get("APR_API_KEY", "")


CREDENTIALS_SCHEMA = marshmallow_dataclass.class_schema(Credentials)()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "auto-pr"
version = "1.0.7"
version = "1.0.8"
description = "Perform bulk updates across repositories"
license = "Apache-2.0"

Expand Down