+
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/run.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
const request = require('./request')

const { GITHUB_SHA, GITHUB_EVENT_PATH, GITHUB_TOKEN, GITHUB_WORKSPACE } = process.env
const { GITHUB_SHA, GITHUB_EVENT_PATH, GITHUB_TOKEN, GITHUB_WORKSPACE, GITHUB_ACTION } = process.env
const event = require(GITHUB_EVENT_PATH)
const { repository } = event
const {
owner: { login: owner }
} = repository
const { name: repo } = repository

const checkName = 'ESLint check'

const headers = {
'Content-Type': 'application/json',
Accept: 'application/vnd.github.antiope-preview+json',
Expand All @@ -19,7 +17,7 @@ const headers = {

async function createCheck() {
const body = {
name: checkName,
name: GITHUB_ACTION,
head_sha: GITHUB_SHA,
status: 'in_progress',
started_at: new Date()
Expand Down Expand Up @@ -64,7 +62,7 @@ function eslint() {
return {
conclusion: errorCount > 0 ? 'failure' : 'success',
output: {
title: checkName,
title: GITHUB_ACTION,
summary: `${errorCount} error(s), ${warningCount} warning(s) found`,
annotations
}
Expand All @@ -73,7 +71,7 @@ function eslint() {

async function updateCheck(id, conclusion, output) {
const body = {
name: checkName,
name: GITHUB_ACTION,
head_sha: GITHUB_SHA,
status: 'completed',
completed_at: new Date(),
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载