-
Notifications
You must be signed in to change notification settings - Fork 12
chore: get input from @actions/core instead of env #11
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
base: main
Are you sure you want to change the base?
Changes from 6 commits
0b6e157
add0f5c
1c00902
eb976ce
8eef1a5
7ecbe06
43263ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,21 @@ | ||
| import { assert } from './utils' | ||
| import { createConfig } from './config' | ||
| import { RyuCho } from './ryu-cho' | ||
| import core from '@actions/core' | ||
|
|
||
| assert(!!process.env.ACCESS_TOKEN, '`accessToken` is required.') | ||
| assert(!!process.env.USER_NAME, '`userName` is required.') | ||
| assert(!!process.env.EMAIL, '`email` is required.') | ||
| assert(!!process.env.UPSTREAM_REPO, '`upstreamRepo` is required.') | ||
| assert(!!process.env.HEAD_REPO, '`headRepo` is required.') | ||
| assert(!!process.env.TRACK_FROM, '`trackFrom` is required.') | ||
| assert(typeof core !== 'undefined', `core is undefined, which probably means you're not running in a GitHub Action`) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this assertion mean that we can no longer test the whole logic in our local environments?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I don't recall. This PR is so old, I've completely forgotten the context of this code, but I think this came from example code somewhere. I'll have to dig to find out the reason for it. |
||
|
|
||
| const config = createConfig({ | ||
| accessToken: process.env.ACCESS_TOKEN!, | ||
| userName: process.env.USER_NAME!, | ||
| email: process.env.EMAIL!, | ||
| upstreamRepo: process.env.UPSTREAM_REPO!, | ||
| upstreamRepoBranch: process.env.UPSTREAM_REPO_BRANCH, | ||
| headRepo: process.env.HEAD_REPO!, | ||
| headRepoBranch: process.env.HEAD_REPO_BRANCH, | ||
| workflowName: process.env.WORKFLOW_NAME, | ||
| trackFrom: process.env.TRACK_FROM!, | ||
| pathStartsWith: process.env.PATH_STARTS_WITH | ||
| accessToken: core.getInput('access-token', { required: true }), | ||
| userName: core.getInput('username', { required: true }), | ||
| email: core.getInput('email', { required: true }), | ||
| upstreamRepo: core.getInput('upstream-repo', { required: true }), | ||
| upstreamRepoBranch: core.getInput('upstream-repo-branch', { required: true }), | ||
| headRepo: core.getInput('head-repo', { required: true }), | ||
| headRepoBranch: core.getInput('head-repo-branch'), | ||
| workflowName: core.getInput('workflow-name'), | ||
| trackFrom: core.getInput('track-from', { required: true }), | ||
| pathStartsWith: core.getInput('path-starts-with'), | ||
| }) | ||
|
|
||
| const ryuCho = new RyuCho(config) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.