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

Update README.md and RELEASE.md to explain GITHUB_AUTH environment variable #103

Merged
merged 3 commits into from
Jun 17, 2020

Conversation

buschtoens
Copy link
Contributor

I tried running this tool, but received this cryptic 404 error:

❯ yarn create rwjblue-release-it-setup
yarn create v1.22.4
[1/4] πŸ”  Resolving packages...
warning create-rwjblue-release-it-setup > github-label-sync > octonode > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ”¨  Building fresh packages...
success Installed "create-rwjblue-release-it-setup@2.9.0" with binaries:
      - create-rwjblue-release-it-setup
[HttpError: Not Found] {
  message: 'Not Found',
  statusCode: 404,
  headers: {
    date: 'Tue, 16 Jun 2020 15:32:32 GMT',
    'content-type': 'application/json; charset=utf-8',
    'content-length': '107',
    connection: 'close',
    server: 'GitHub.com',
    status: '404 Not Found',
    'x-ratelimit-limit': '60',
    'x-ratelimit-remaining': '59',
    'x-ratelimit-reset': '1592325152',
    'x-github-media-type': 'github.v3; param=symmetra-preview; format=json',
    'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
    'access-control-allow-origin': '*',
    'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
    'x-frame-options': 'deny',
    'x-content-type-options': 'nosniff',
    'x-xss-protection': '1; mode=block',
    'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
    'content-security-policy': "default-src 'none'",
    vary: 'Accept-Encoding, Accept, X-Requested-With',
    'x-github-request-id': 'E5B8:36872:50BA98:62C6D6:5EE8E610'
  },
  body: {
    message: 'Not Found',
    documentation_url: 'https://developer.github.com/v3/issues/labels/#update-a-label'
  },
  method: 'PATCH',
  endpoint: '/repos/ClarkSource/eslint-config/labels/good%20first%20issue'
}
(node:35691) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:35691) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✨  Done in 15.25s.

I read through the source code and realized that it implicitly expects the GITHUB_AUTH env var to be set. After setting the variable, it worked! ✨

To save others from running into this as well, I updated the docs to explain this prerequisite setup.

README.md Outdated
Comment on lines 15 to 22
### Prerequisites

1. Obtain a [GitHub personal access token][generate-token].
2. Make sure the [token is available as the `GITHUB_AUTH` environment variable][export-token].
For instance:
```bash
export GITHUB_AUTH=abc123def456
```
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we recommend a specific env setup here? Personally I use direnv, but I'm a bit worried that some nasty package in node_modules may sniff my env vars. I wonder, how have you configured it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't. Setting environment variables is a common enough task that it's a reasonable context to assume and I don't think this repo should be opinionated one way or another on how they're set.

Copy link
Collaborator

@hjdivad hjdivad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @buschtoens! This looks great, it's always nice to get doc improvements.

The only change I'd like to see is not linking to the release-it docs since they use a different env name, although I don't think it's particularly important either way.

README.md Outdated
Comment on lines 15 to 22
### Prerequisites

1. Obtain a [GitHub personal access token][generate-token].
2. Make sure the [token is available as the `GITHUB_AUTH` environment variable][export-token].
For instance:
```bash
export GITHUB_AUTH=abc123def456
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't. Setting environment variables is a common enough task that it's a reasonable context to assume and I don't think this repo should be opinionated one way or another on how they're set.

README.md Outdated Show resolved Hide resolved
@hjdivad hjdivad merged commit 6d05586 into rwjblue:master Jun 17, 2020
@hjdivad
Copy link
Collaborator

hjdivad commented Jun 17, 2020

Thanks @buschtoens!

@buschtoens buschtoens deleted the patch-1 branch June 17, 2020 14:18
@rwjblue rwjblue changed the title docs(README): explain GITHUB_AUTH env var Update README.md and RELEASE.md to explain GITHUB_AUTH environment variable Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants