Skip to content

Commit

Permalink
Merge pull request #140 from johnpangalos/main
Browse files Browse the repository at this point in the history
Support dependency review
  • Loading branch information
adpi2 authored Nov 6, 2023
2 parents 4141697 + 74bd994 commit f517a6e
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 9 deletions.
196 changes: 187 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.0",
"@actions/github": "^6.0.0",
"@actions/io": "^1.1.3"
},
"devDependencies": {
"@octokit/webhooks-types": "^7.3.1",
"@types/node": "^17.0.30",
"@vercel/ncc": "^0.38.1",
"eslint-plugin-github": "^4.9.0",
Expand Down
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as cli from '@actions/exec'
import * as core from '@actions/core'
import * as io from '@actions/io'
import * as github from '@actions/github'
import * as crypto from 'crypto'
import * as fs from 'fs'
import * as fsPromises from 'fs/promises'
import * as path from 'path'
import type { PullRequestEvent } from '@octokit/webhooks-types'

async function run(): Promise<void> {
try {
Expand Down Expand Up @@ -48,6 +50,13 @@ async function run(): Promise<void> {

const input = { ignoredModules, ignoredConfigs, onResolveFailure }

if (github.context.eventName === 'pull_request') {
core.info('pull request, resetting sha')
const payload = github.context.payload as PullRequestEvent
core.info(`setting sha to: ${payload.pull_request.head.sha}`)
process.env['GITHUB_SHA'] = payload.pull_request.head.sha
}

process.env['GITHUB_TOKEN'] = token
await cli.exec('sbt', ['--batch', `githubSubmitDependencyGraph ${JSON.stringify(input)}`], {
cwd: workingDir,
Expand Down

0 comments on commit f517a6e

Please sign in to comment.