Skip to content

Commit

Permalink
Automatically run push on commits to main
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored Feb 12, 2024
1 parent 0b51002 commit bee83aa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ async function run(): Promise<void> {
const token = core.getInput('github-token')
octokit = github.getOctokit(token)
const { eventName, repo, payload } = github.context
console.log({ eventName, payload });
const issue_number = payload.pull_request?.number
core.info(JSON.stringify(payload, null, 2))

// On push to default branch, push to Astro Studio
if (eventName === 'push' && payload.ref === `refs/heads/${payload.repository.default_branch}`) {
await push();
return;
}

// Otherwise, run verify and leave a PR comment
const issue_number = payload.pull_request?.number
const { success, message } = await verify();

if (!issue_number) {
Expand Down

0 comments on commit bee83aa

Please sign in to comment.