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

GitHubに投稿するアカウントのログイン情報を書かなくてよいようにする #10

Open
attache-case opened this issue Jul 6, 2017 · 0 comments

Comments

@attache-case
Copy link
Owner

attache-case commented Jul 6, 2017

https://github.com/attache-case/omoitsukibot/blob/master/plugins/Github_func.py#L7-L10
にあるように、環境変数でとはいえGitHubに(代理)投稿するアカウントのログイン情報を書くようになっているので、これをGitHubのPersonal Access Tokenで代替できないか。

その場合、環境変数として

GITHUB_TOKEN = {{your personal access token}}

を登録したうえで、

Github_func.pyのグローバル部分に次の行を追加

TOKEN = os.environ.get('GITHUB_TOKEN')

同ファイルのGitHub認証部分
https://github.com/attache-case/omoitsukibot/blob/master/plugins/Github_func.py#L22
について

session.auth = (TOKEN) # TOKENを使った認証にする。この書き方で良いかは不明。

のような変更をすれば良さそう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant