mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2026-04-04 16:56:52 +00:00
feat: use action input instead of env var to get the github token
BREAKING CHANGE: GITHUB_TOKEN env var is now ignored. In case a custom token is needed, it'll be necessary to pass it via the `token` input from now on.
This commit is contained in:
parent
a413a3f439
commit
18e9bff0e6
4 changed files with 26 additions and 19 deletions
|
|
@ -10,7 +10,7 @@ const generateOutputs = require('./generateOutputs')
|
|||
|
||||
const pullRequestEvent = 'pull_request'
|
||||
|
||||
const { GITHUB_TOKEN, GITHUB_EVENT_NAME, GITHUB_SHA } = process.env
|
||||
const { GITHUB_EVENT_NAME, GITHUB_SHA } = process.env
|
||||
|
||||
const configPath = resolve(
|
||||
process.env.GITHUB_WORKSPACE,
|
||||
|
|
@ -47,7 +47,7 @@ const getRangeForPushEvent = () => {
|
|||
const getRangeForEvent = async () => {
|
||||
if (GITHUB_EVENT_NAME !== pullRequestEvent) return getRangeForPushEvent()
|
||||
|
||||
const octokit = new github.GitHub(GITHUB_TOKEN)
|
||||
const octokit = new github.GitHub(core.getInput('token'))
|
||||
const { owner, repo, number } = eventContext.issue
|
||||
const { data: commits } = await octokit.pulls.listCommits({
|
||||
owner,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue