Skip to content

Commit dd4c654

Browse files
committed
Rename environment variable
1 parent 2551fd7 commit dd4c654

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This documentation aims to demonstrate practices that facilitate design reuse, i
5656

5757
In addition, this repository aims to follow international standards and good practices in open source development such as, but not limited to:
5858

59-
* [SDPX](https://chaoss.community/) compliance with a [LICENSE](./LICENSE) file (also see [License](#license) section)
59+
* [SDPX](https://spdx.dev/) compliance with a [LICENSE](./LICENSE) file (also see [License](#license) section)
6060
* [REUSE](https://reuse.software/) compliance with appropriate machine-readable SPDX metadata for all files and license texts in [`LICENSES`](./LICENSES/) directory
6161
* README file (this document) conforming to the [Standard Readme Specification](https://github.com/RichardLitt/standard-readme)
6262
* [Contributor Covenant](https://www.contributor-covenant.org/) Code of Conduct for participants
@@ -130,7 +130,7 @@ This module should be run first to produce the dataset for the `osdash` dashboar
130130

131131
An example CSV list is included with this repository in [`input/OSH-repos.csv`](./input/OSH-repos.csv) and can be used out-of-the-box. This list was used to obtain the data visualised in the dashboard [demo instance](https://psaltyi.pythonanywhere.com/).
132132

133-
2. Obtain a [GitHub personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token), which is a 40-character alphanumeric string in the form of `22x9w3npi629wgam5s6xxxen5abrozeb3db2mr42`. A GitHub account is required for this step. This token can be fed to `osmine` as: The environmental variable `GITHUB_TOKEN`; a path to a one-line pure-text file containing the string as a command line argument (see step 4); or directly in the configuration file (see step 3.).
133+
2. Obtain a [GitHub personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token), which is a 40-character alphanumeric string in the form of `22x9w3npi629wgam5s6xxxen5abrozeb3db2mr42`. A GitHub account is required for this step. This token can be fed to `osmine` as: The environment variable `GH_TOKEN`; a path to a one-line pure-text file containing the string as a command line argument (see step 4); or directly in the configuration file (see step 3.).
134134

135135
3. Set up configuration file.
136136

osmine/preprocess/read_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ def read_config() -> dict:
9494

9595
# Read GitHub token from environment variable if it is there
9696
# Reference: https://stackoverflow.com/q/40697845/186904
97-
if "GITHUB_TOKEN" in os.environ:
98-
logging.info(f"Reading GitHub token from environment variable GITHUB_TOKEN")
99-
configuration["GitHub_token"] = os.environ["GITHUB_TOKEN"]
97+
if "GH_TOKEN" in os.environ:
98+
logging.info(f"Reading GitHub token from environment variable GH_TOKEN")
99+
configuration["GitHub_token"] = os.environ["GH_TOKEN"]
100100

101101
#
102102
# Apply commandline arguments
@@ -133,7 +133,7 @@ def read_config() -> dict:
133133
#
134134

135135
# Put the authentication string into its own entry
136-
if not("GITHUB_TOKEN" in os.environ):
136+
if not("GH_TOKEN" in os.environ):
137137
# I.e. Try to open token file if the token is not already read from environment
138138
try:
139139
with open(configuration["GitHub_token"], mode="r") as token_file:

0 commit comments

Comments
 (0)