File tree 3 files changed +11
-13
lines changed 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ Applying Patches To All CircuitPython Libraries
115
115
================================================
116
116
To apply a patch to all CircuitPython libraries (only guaranteed for files shared
117
117
among all libraries, such as those included in the cookiecutter (e.g. README.rst,
118
- .travis.yml, etc), do the following:
118
+ etc), do the following:
119
119
120
120
1. Apply your update(s) to any library as normal, using ``git commit ``. It is recommended to
121
121
give a short, detailed description of the patch. This description will be used by the next
Original file line number Diff line number Diff line change 35
35
import time
36
36
import traceback
37
37
38
+ from base64 import b64encode
39
+
38
40
TIMEOUT = 60
39
41
40
42
def _fix_url (url ):
@@ -52,11 +54,12 @@ def _fix_kwargs(kwargs):
52
54
else :
53
55
kwargs ["headers" ] = {"Accept" : "application/vnd.github.hellcat-preview+json" }
54
56
if "ADABOT_GITHUB_ACCESS_TOKEN" in os .environ and "auth" not in kwargs :
57
+ user = os .environ .get ("ADABOT_GITHUB_USER" , "" )
55
58
access_token = os .environ ["ADABOT_GITHUB_ACCESS_TOKEN" ]
56
- if "params" in kwargs :
57
- kwargs [ "params" ][ "access_token" ] = access_token
58
- else :
59
- kwargs ["params" ] = { "access_token" : access_token }
59
+ basic_encoded = b64encode ( str ( user + ":" + access_token ). encode ()). decode ()
60
+ auth_header = "Basic {}" . format ( basic_encoded )
61
+
62
+ kwargs ["headers" ][ "Authorization" ] = auth_header
60
63
61
64
return kwargs
62
65
Original file line number Diff line number Diff line change 2
2
# https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
3
3
# KEEP THIS TOKEN SECRET AND SAFE! Anyone with access to the token has FULL CONTROL of your GitHub account!
4
4
export ADABOT_GITHUB_ACCESS_TOKEN=< your personal access token>
5
- # Go here to generate a travis access token:
6
- # https://blog.travis-ci.com/2013-01-28-token-token-token
7
- # Note you want the 'Travis Token' (third option) and NOT the 'Access Token'. Use the ruby gem mentioned to generate.
8
- # KEEP THIS TOKEN SECRET AND SAFE! Although it is unclear what access the token grants (Travis seems to imply it's less
9
- # risk to share), always assume secrets like these are dangerous to expose to others.
10
- # Note 2: since all CircuitPython repositories have been migragted to travis-ci.com, be sure to use an access token
11
- # from '.com', not '.org'. These tokens are not interchangeable.
12
- export ADABOT_TRAVIS_ACCESS_TOKEN=< your Travis token>
5
+
6
+ # This is the username associated with the access token.
7
+ export ADABOT_GITHUB_USER=< username>
You can’t perform that action at this time.
0 commit comments