Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add repository parameter #19

Merged
merged 5 commits into from
Nov 16, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Update index.js
  • Loading branch information
TravisEz13 authored Nov 16, 2021
commit 627efec7eda1882c8c61a6cabdcd0ad53d1bd38f
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -6,20 +6,20 @@ const { GitHub, context } = require('@actions/github')
const main = async () => {
const token = core.getInput('github-token')
const number = core.getInput('number')
const repo = core.getInput('repo')
const repoString = core.getInput('repo')

var repoValue
if (!repo) {
repoValue = context.repo
let repoObject
if (repoString) {
const [owner, repo] = repoString.split('/')
repoObject = { owner, repo }
} else {
const [owner, repo] = repo.split('/')
repoValue = {owner, repo}
repoObject = context.repo
}

const octokit = new GitHub(token)

await octokit.pulls.createReview({
...repoValue,
...repoObject,
pull_number: number,
event: 'APPROVE'
})