Skip to content

Commit

Permalink
test4
Browse files Browse the repository at this point in the history
  • Loading branch information
hulk510 committed Jan 17, 2024
1 parent c2148ea commit 7c7b467
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions dist/index.js

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

10 changes: 8 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function run(): Promise<void> {
// MEMO: git contextからheadRefは取得できなそう
const { repo, ref } = github.context
core.info(`ref: ${ref}`)
core.info(`request: ${JSON.stringify(github.context.payload.pull_request)}`)
core.info(`payload: ${JSON.stringify(github.context.payload)}`)
core.info(
`number: ${JSON.stringify(github.context.payload.pull_request?.number)}`
)
Expand All @@ -49,14 +49,20 @@ export async function run(): Promise<void> {
github.context.payload.pull_request?.head.ref
)}`
)

// const eventPath = process.env.GITHUB_EVENT_PATH

const headRef = process.env.GITHUB_HEAD_REF
core.info(`headRef: ${headRef}`)
const prNumber = github.context.payload.pull_request?.number

if (prNumber) {
deleteRefActionsCache(octokit, repo, `refs/pull/${prNumber}/merge`)
}
if (headRef) {
deleteRefActionsCache(octokit, repo, headRef)
deleteRefActionsCache(octokit, repo, `refs/heads/${headRef}`)
}
// workflow_dispatch or push
deleteRefActionsCache(octokit, repo, ref)
} catch (error) {
// Fail the workflow run if an error occurs
Expand Down

0 comments on commit 7c7b467

Please sign in to comment.