Compare commits

...

2 Commits

Author SHA1 Message Date
Tonye Jack
043929ee8f feat: add support for running on release event (#1191)
Co-authored-by: GitHub Action <action@github.com>
2023-05-28 19:56:55 -06:00
tj-actions[bot]
96fd19710a Upgraded to v36.0.7 (#1190)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-05-29 01:42:54 +00:00
5 changed files with 39 additions and 7 deletions

View File

@@ -1,5 +1,27 @@
# Changelog
# [36.0.7](https://github.com/tj-actions/changed-files/compare/v36.0.6...v36.0.7) - (2023-05-29)
## <!-- 1 -->🐛 Bug Fixes
- Bug running changed files with limited history ([#1188](https://github.com/tj-actions/changed-files/issues/1188)) ([449a845](https://github.com/tj-actions/changed-files/commit/449a845ff28da516ea1752afd195d2f7f642c6f4)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update README.md ([777b2b4](https://github.com/tj-actions/changed-files/commit/777b2b437a82c8afbb474f57812fd790c7509391)) - (Tonye Jack)
- Update README.md ([2fafe0a](https://github.com/tj-actions/changed-files/commit/2fafe0a7349fddf5ea3a02484419a4831979d79b)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Lock file maintenance ([#1189](https://github.com/tj-actions/changed-files/issues/1189)) ([4e2535f](https://github.com/tj-actions/changed-files/commit/4e2535f2b330e70ff7055f7de4272653cfdbd555)) - (renovate[bot])
- **deps:** Update tj-actions/eslint-changed-files action to v19 ([#1185](https://github.com/tj-actions/changed-files/issues/1185)) ([bc88d8b](https://github.com/tj-actions/changed-files/commit/bc88d8bc954005f987c5c73e133f2cb4927ddf3e)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v36.0.6 ([#1184](https://github.com/tj-actions/changed-files/issues/1184))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([fd2b77d](https://github.com/tj-actions/changed-files/commit/fd2b77dd749ff644f3fe50e1f7341902e0064744)) - (tj-actions[bot])
# [36.0.6](https://github.com/tj-actions/changed-files/compare/v36.0.5...v36.0.6) - (2023-05-26)
## <!-- 0 -->🚀 Features

12
dist/index.js generated vendored
View File

@@ -213,7 +213,8 @@ const getSHAForPushEvent = (inputs, env, workingDirectory, isShallow, hasSubmodu
if (isShallow) {
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;
yield (0, utils_1.gitFetch)({
cwd: workingDirectory,
args: [
@@ -568,7 +569,7 @@ exports.getEnv = void 0;
const fs_1 = __nccwpck_require__(7147);
const core = __importStar(__nccwpck_require__(2186));
const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
var _a, _b, _c, _d, _e, _f, _g, _h;
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
const eventPath = process.env.GITHUB_EVENT_PATH;
let eventJson = {};
if (eventPath) {
@@ -581,9 +582,10 @@ const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
GITHUB_EVENT_PULL_REQUEST_BASE_REF: ((_d = (_c = eventJson.pull_request) === null || _c === void 0 ? void 0 : _c.base) === null || _d === void 0 ? void 0 : _d.ref) || '',
GITHUB_EVENT_BEFORE: eventJson.before || '',
GITHUB_EVENT_BASE_REF: eventJson.base_ref || '',
GITHUB_EVENT_HEAD_REPO_FORK: ((_e = eventJson.head_repo) === null || _e === void 0 ? void 0 : _e.fork) || '',
GITHUB_EVENT_PULL_REQUEST_NUMBER: ((_f = eventJson.pull_request) === null || _f === void 0 ? void 0 : _f.number) || '',
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ((_h = (_g = eventJson.pull_request) === null || _g === void 0 ? void 0 : _g.base) === null || _h === void 0 ? void 0 : _h.sha) || '',
GITHUB_EVENT_RELEASE_TARGET_COMMITISH: ((_e = eventJson.release) === null || _e === void 0 ? void 0 : _e.target_commitish) || '',
GITHUB_EVENT_HEAD_REPO_FORK: ((_f = eventJson.head_repo) === null || _f === void 0 ? void 0 : _f.fork) || '',
GITHUB_EVENT_PULL_REQUEST_NUMBER: ((_g = eventJson.pull_request) === null || _g === void 0 ? void 0 : _g.number) || '',
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ((_j = (_h = eventJson.pull_request) === null || _h === void 0 ? void 0 : _h.base) === null || _j === void 0 ? void 0 : _j.sha) || '',
GITHUB_EVENT_FORCED: eventJson.forced || '',
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
GITHUB_REF: process.env.GITHUB_REF || '',

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -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: [

View File

@@ -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 || '',