cloudbuild-task-github-actions
Advanced tools
Comparing version
@@ -43,8 +43,7 @@ "use strict"; | ||
this.result = new TaskResult_1.TaskResult(); | ||
if (github.context.eventName === 'pull_request') { | ||
const pullRequestPayload = github.context.payload; | ||
if (github.context.payload.pull_request) { | ||
this.pullRequest = { | ||
id: pullRequestPayload.number, | ||
targetBranch: pullRequestPayload.pull_request.base, | ||
sourceBranch: pullRequestPayload.pull_request.head, | ||
id: github.context.payload.number, | ||
targetBranch: github.context.payload.pull_request.base, | ||
sourceBranch: github.context.payload.pull_request.head, | ||
}; | ||
@@ -51,0 +50,0 @@ } |
{ | ||
"name": "cloudbuild-task-github-actions", | ||
"version": "0.1.105-beta", | ||
"version": "0.1.122-beta", | ||
"description": "A GitHub Actions adapter for the cloudbuild-task-contracts.", | ||
@@ -30,15 +30,15 @@ "main": "lib/index.js", | ||
"@actions/io": "^1.0.2", | ||
"@actions/tool-cache": "^1.6.0", | ||
"@octokit/webhooks": "^7.15.1", | ||
"cloudbuild-task-contracts": "0.1.105-beta" | ||
"@actions/tool-cache": "^1.6.1", | ||
"@octokit/webhooks": "^8.4.1", | ||
"cloudbuild-task-contracts": "0.1.122-beta" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.8", | ||
"@types/node": "^14.0.27", | ||
"jest": "^26.4.2", | ||
"@types/jest": "^26.0.20", | ||
"@types/node": "^14.14.31", | ||
"jest": "^26.6.3", | ||
"jshint": "^2.12.0", | ||
"ts-jest": "^26.3.0", | ||
"ts-jest": "^26.5.2", | ||
"tslint": "^6.1.3", | ||
"typescript": "^4.0.2" | ||
"typescript": "^4.2.2" | ||
} | ||
} |
@@ -8,3 +8,2 @@ import * as contracts from 'cloudbuild-task-contracts'; | ||
import * as github from '@actions/github'; | ||
import { EventPayloads } from '@octokit/webhooks' | ||
@@ -27,8 +26,7 @@ class GitHubFactory implements contracts.CloudTask { | ||
constructor() { | ||
if (github.context.eventName === 'pull_request') { | ||
const pullRequestPayload = github.context.payload as EventPayloads.WebhookPayloadPullRequest; | ||
if (github.context.payload.pull_request) { | ||
this.pullRequest = { | ||
id: pullRequestPayload.number, | ||
targetBranch: pullRequestPayload.pull_request.base, | ||
sourceBranch: pullRequestPayload.pull_request.head, | ||
id: github.context.payload.number, | ||
targetBranch: github.context.payload.pull_request.base, | ||
sourceBranch: github.context.payload.pull_request.head, | ||
}; | ||
@@ -35,0 +33,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21039
-0.95%354
-0.84%+ Added
+ Added
+ Added
- Removed
- Removed
Updated
Updated