Skip to content

Commit

Permalink
update pre
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Mar 11, 2024
1 parent ace0a26 commit 53ce9e2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,26 @@ const UNIQUE_IDENTIFIER = '<!-- @astrojs/action-studio -->';
async function run(): Promise<void> {
const token = core.getInput('github-token')
const octokit = github.getOctokit(token)
const { eventName, repo, payload } = github.context;
const { eventName, repo, runId } = github.context;
console.log(github.context);
console.log(process.env);
console.log({
owner: repo.owner,
repo: repo.repo,
run_id: runId
});

// On push to any branch defined in `on: ...`, run `astro db push`
console.log('Event:', eventName);

if (eventName !== 'push') {
return;
}

const jobInfo = await octokit.rest.actions.listJobsForWorkflowRun({
owner: repo.owner,
repo: repo.repo,
run_id: payload.runId
run_id: runId
});
console.log('Job info:', jobInfo);
const job = jobInfo.data.jobs.find(job => job.name === 'build');
Expand Down

0 comments on commit 53ce9e2

Please sign in to comment.