mirror of
https://github.com/tj-actions/changed-files
synced 2025-01-29 13:34:51 +00:00
feat: add support for running on release event (#1191)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
parent
96fd19710a
commit
043929ee8f
4 changed files with 9 additions and 1 deletions
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
|
@ -83,7 +83,9 @@ export const getSHAForPushEvent = async (
|
|||
core.info('Repository is shallow, fetching more history...')
|
||||
|
||||
if (isTag) {
|
||||
const sourceBranch = env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '')
|
||||
const sourceBranch =
|
||||
env.GITHUB_EVENT_BASE_REF.replace('refs/heads/', '') ||
|
||||
env.GITHUB_EVENT_RELEASE_TARGET_COMMITISH
|
||||
await gitFetch({
|
||||
cwd: workingDirectory,
|
||||
args: [
|
||||
|
|
|
@ -8,6 +8,7 @@ export type Env = {
|
|||
GITHUB_REF_NAME: string
|
||||
GITHUB_REF: string
|
||||
GITHUB_EVENT_BASE_REF: string
|
||||
GITHUB_EVENT_RELEASE_TARGET_COMMITISH: string
|
||||
GITHUB_EVENT_HEAD_REPO_FORK: string
|
||||
GITHUB_WORKSPACE: string
|
||||
GITHUB_EVENT_FORCED: string
|
||||
|
@ -27,6 +28,9 @@ type GithubEvent = {
|
|||
}
|
||||
number: string
|
||||
}
|
||||
release?: {
|
||||
target_commitish: string
|
||||
}
|
||||
before?: string
|
||||
base_ref?: string
|
||||
head_repo?: {
|
||||
|
@ -49,6 +53,8 @@ export const getEnv = async (): Promise<Env> => {
|
|||
GITHUB_EVENT_PULL_REQUEST_BASE_REF: eventJson.pull_request?.base?.ref || '',
|
||||
GITHUB_EVENT_BEFORE: eventJson.before || '',
|
||||
GITHUB_EVENT_BASE_REF: eventJson.base_ref || '',
|
||||
GITHUB_EVENT_RELEASE_TARGET_COMMITISH:
|
||||
eventJson.release?.target_commitish || '',
|
||||
GITHUB_EVENT_HEAD_REPO_FORK: eventJson.head_repo?.fork || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_NUMBER: eventJson.pull_request?.number || '',
|
||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: eventJson.pull_request?.base?.sha || '',
|
||||
|
|
Loading…
Reference in a new issue