-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Upgrade octokit/core and actions (#1404)
- Loading branch information
Showing
16 changed files
with
15,356 additions
and
16,025 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ node_modules/ | |
package-lock.json | ||
dist/ | ||
action/ | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
// Must include .pnp before anything else | ||
// require('../.pnp.js').setup(); | ||
|
||
import * as core from '@actions/core'; | ||
import { info, getInput, setFailed } from '@actions/core'; | ||
import { getOctokit } from '@actions/github'; | ||
import { Context } from '@actions/github/lib/context'; | ||
import assert from 'assert'; | ||
import { isAppError, isError } from './error'; | ||
import { action } from './action'; | ||
import { format } from 'util'; | ||
|
||
function getGithubToken(): string { | ||
const t0 = core.getInput('github_token', { required: true }); | ||
function getGithubToken(): string | undefined { | ||
const t0 = getInput('github_token', { required: true }); | ||
if (t0[0] !== '$') { | ||
return t0; | ||
return t0 !== 'undefined' ? t0 : undefined; | ||
} | ||
return process.env[t0.slice(1)] || 'undefined'; | ||
return process.env[t0.slice(1)] || undefined; | ||
} | ||
|
||
export async function run(): Promise<void> { | ||
export async function run(): Promise<undefined | Error> { | ||
try { | ||
core.info('cspell-action'); | ||
info('cspell-action'); | ||
const githubContext = new Context(); | ||
const githubToken = getGithubToken(); | ||
assert(githubToken, 'GITHUB_TOKEN is required.'); | ||
|
||
await action(githubContext, getOctokit(githubToken)); | ||
core.info('Done.'); | ||
info('Done.'); | ||
return undefined; | ||
} catch (error) { | ||
console.error(error); | ||
core.setFailed(isAppError(error) ? error.message : isError(error) ? error : format(error)); | ||
setFailed(isAppError(error) ? error.message : isError(error) ? error : format(error)); | ||
return isError(error) ? error : Error(format(error)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.