Skip to content

Commit

Permalink
feat: resolve issues with running this action on a schedule (#222)
Browse files Browse the repository at this point in the history
* Remove refs from schedule

* chore: cleanup console.log entry to check event data

* chore: build

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
SamTealeDrest and github-actions[bot] authored Jan 23, 2023
1 parent 3ef561f commit 3494273
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 644 deletions.
202 changes: 3 additions & 199 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

18 changes: 2 additions & 16 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,8 @@ export async function getSha(
break
}
case 'schedule': {
const payload = context.payload as WorkflowDispatchEvent

const ref = await octokit.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: payload.ref.replace('refs/', ''),
})

const commit = await octokit.rest.git.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: ref.data.object.sha,
})

base = commit.data.parents[0].sha
head = commit.data.sha
base = context.sha
head = context.sha
break
}
default:
Expand Down
Loading

0 comments on commit 3494273

Please sign in to comment.