Compare commits

...

7 Commits

Author SHA1 Message Date
Tonye Jack
b13786805a chore: update README.md (#1225)
Co-authored-by: GitHub Action <action@github.com>
2023-06-04 21:51:28 -06:00
renovate[bot]
7c72320404 chore(deps): lock file maintenance (#1224)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com>
Co-authored-by: GitHub Action <action@github.com>
2023-06-04 21:46:30 -06:00
Tonye Jack
763a7bfbb5 chore: Update test.yml (#1223)
Co-authored-by: tj-actions[bot] <109116665+tj-actions-bot@users.noreply.github.com>
2023-06-04 20:09:02 -06:00
tj-actions[bot]
c789aecfa6 Upgraded to v36.0.16 (#1222)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-06-04 16:48:50 +00:00
renovate[bot]
1aae16084a chore(deps): lock file maintenance (#1221)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-03 01:21:45 +00:00
renovate[bot]
a593948c90 chore(deps): update dependency eslint to v8.42.0 (#1220)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-03 01:07:36 +00:00
tj-actions[bot]
96134b7430 Upgraded to v36.0.15 (#1219)
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
2023-06-02 13:53:01 +00:00
10 changed files with 78 additions and 34 deletions

View File

@@ -4,14 +4,11 @@ on:
push:
branches:
- "**"
pull_request_review:
pull_request_target:
pull_request:
branches:
- main
- sec
pull_request_review:
branches:
- main
- sec
jobs:
shellcheck:

View File

@@ -1,5 +1,41 @@
# Changelog
# [36.0.16](https://github.com/tj-actions/changed-files/compare/v36.0.15...v36.0.16) - (2023-06-03)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Lock file maintenance ([#1221](https://github.com/tj-actions/changed-files/issues/1221)) ([1aae160](https://github.com/tj-actions/changed-files/commit/1aae16084af435f73c8cdfd742473028810c5f20)) - (renovate[bot])
- **deps:** Update dependency eslint to v8.42.0 ([#1220](https://github.com/tj-actions/changed-files/issues/1220)) ([a593948](https://github.com/tj-actions/changed-files/commit/a593948c900d7f83d14a30cb162657a8d9894b0e)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v36.0.15 ([#1219](https://github.com/tj-actions/changed-files/issues/1219))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com> ([96134b7](https://github.com/tj-actions/changed-files/commit/96134b7430da6261abf9182b7f2df2ae06eee300)) - (tj-actions[bot])
# [36.0.15](https://github.com/tj-actions/changed-files/compare/v36.0.14...v36.0.15) - (2023-06-02)
## <!-- 1 -->🐛 Bug Fixes
- Bug retrieving base sha for force push ([#1216](https://github.com/tj-actions/changed-files/issues/1216)) ([47db5bd](https://github.com/tj-actions/changed-files/commit/47db5bd435ab26939338ff899af621be52f44da4)) - (Tonye Jack)
## <!-- 26 -->🔄 Update
- Update README.md ([5436326](https://github.com/tj-actions/changed-files/commit/5436326dcff90d144b503f5956174744e1e2f3dd)) - (Tonye Jack)
## <!-- 7 -->⚙️ Miscellaneous Tasks
- **deps:** Update dependency typescript to v5.1.3 ([#1215](https://github.com/tj-actions/changed-files/issues/1215)) ([5d2fcdb](https://github.com/tj-actions/changed-files/commit/5d2fcdb4cbef720a52f49fd05d8c7edd18a64758)) - (renovate[bot])
- **deps:** Update dependency eslint-plugin-github to v4.8.0 ([#1218](https://github.com/tj-actions/changed-files/issues/1218)) ([c0a8bcf](https://github.com/tj-actions/changed-files/commit/c0a8bcfa6aa8d8cb3617f30d7a97a9a94233f526)) - (renovate[bot])
- **deps:** Lock file maintenance ([#1217](https://github.com/tj-actions/changed-files/issues/1217)) ([4bc117d](https://github.com/tj-actions/changed-files/commit/4bc117de0ccad2c57bf65627d45b5a397ad7aeab)) - (renovate[bot])
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v36.0.14 ([#1214](https://github.com/tj-actions/changed-files/issues/1214))
Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([eeb5a25](https://github.com/tj-actions/changed-files/commit/eeb5a258f54ff87633389337e566ad43b7429c8d)) - (tj-actions[bot])
# [36.0.14](https://github.com/tj-actions/changed-files/compare/v36.0.13...v36.0.14) - (2023-06-01)
## <!-- 1 -->🐛 Bug Fixes

View File

@@ -19,7 +19,7 @@
## changed-files
Retrieve all changed files and directories relative to a target branch, preceeding commit or the last remote commit returning a **relative path** from the project root.
Retrieve all changed files and directories relative to a target branch, preceeding commit or the last remote commit returning **relative paths** from the project root.
## Table of contents

14
dist/index.js generated vendored
View File

@@ -409,7 +409,7 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
}
core.info('Completed fetching more history.');
}
const currentSha = yield getCurrentSHA({ inputs, workingDirectory });
let currentSha = yield getCurrentSHA({ inputs, workingDirectory });
let previousSha = inputs.baseSha;
let diff = '...';
if (previousSha && currentSha && currentBranch && targetBranch) {
@@ -485,6 +485,9 @@ const getSHAForPullRequestEvent = (inputs, env, workingDirectory, isShallow, has
previousSha = env.GITHUB_EVENT_PULL_REQUEST_BASE_SHA;
}
}
if (previousSha === currentSha && env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA) {
currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA;
}
if (!(yield (0, utils_1.canDiffCommits)({
cwd: workingDirectory,
sha1: previousSha,
@@ -563,7 +566,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, _j;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
const eventPath = process.env.GITHUB_EVENT_PATH;
let eventJson = {};
if (eventPath) {
@@ -580,6 +583,7 @@ const getEnv = () => __awaiter(void 0, void 0, void 0, function* () {
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_PULL_REQUEST_HEAD_SHA: ((_l = (_k = eventJson.pull_request) === null || _k === void 0 ? void 0 : _k.head) === null || _l === void 0 ? void 0 : _l.sha) || '',
GITHUB_EVENT_FORCED: eventJson.forced || '',
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
GITHUB_REF: process.env.GITHUB_REF || '',
@@ -1386,7 +1390,7 @@ const getSubmodulePath = ({ cwd }) => __awaiter(void 0, void 0, void 0, function
return stdout
.trim()
.split('\n')
.map(line => normalizePath(line.split(' ')[1]));
.map((line) => normalizePath(line.split(' ')[1]));
});
exports.getSubmodulePath = getSubmodulePath;
const gitSubmoduleDiffSHA = ({ cwd, parentSha1, parentSha2, submodulePath, diff }) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1435,7 +1439,7 @@ const gitRenamedFiles = ({ cwd, sha1, sha2, diff, oldNewSeparator, isSubmodule =
.trim()
.split('\n')
.filter(Boolean)
.map(line => {
.map((line) => {
core.debug(`Renamed file: ${line}`);
const [, oldPath, newPath] = line.split('\t');
if (isSubmodule) {
@@ -1471,7 +1475,7 @@ const gitDiff = ({ cwd, sha1, sha2, diff, diffFilter, filePatterns = [], isSubmo
const files = stdout
.split('\n')
.filter(Boolean)
.map(p => {
.map((p) => {
if (isSubmodule) {
return normalizePath(path.join(parentDir, p));
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -44,7 +44,7 @@
"@typescript-eslint/eslint-plugin": "5.59.8",
"@typescript-eslint/parser": "5.59.8",
"@vercel/ncc": "0.36.1",
"eslint": "8.41.0",
"eslint": "8.42.0",
"eslint-plugin-github": "4.8.0",
"eslint-plugin-jest": "27.2.1",
"eslint-plugin-prettier": "^4.2.1",

View File

@@ -321,7 +321,7 @@ export const getSHAForPullRequestEvent = async (
core.info('Completed fetching more history.')
}
const currentSha = await getCurrentSHA({inputs, workingDirectory})
let currentSha = await getCurrentSHA({inputs, workingDirectory})
let previousSha = inputs.baseSha
let diff = '...'
@@ -425,6 +425,10 @@ export const getSHAForPullRequestEvent = async (
}
}
if (previousSha === currentSha && env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA) {
currentSha = env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA
}
if (
!(await canDiffCommits({
cwd: workingDirectory,

View File

@@ -14,6 +14,7 @@ export type Env = {
GITHUB_EVENT_FORCED: string
GITHUB_EVENT_PULL_REQUEST_NUMBER: string
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: string
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: string
}
type GithubEvent = {
@@ -21,6 +22,7 @@ type GithubEvent = {
pull_request?: {
head: {
ref: string
sha: string
}
base: {
ref: string
@@ -58,6 +60,7 @@ export const getEnv = async (): Promise<Env> => {
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 || '',
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: eventJson.pull_request?.head?.sha || '',
GITHUB_EVENT_FORCED: eventJson.forced || '',
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME || '',
GITHUB_REF: process.env.GITHUB_REF || '',

View File

@@ -288,7 +288,7 @@ export const getSubmodulePath = async ({
return stdout
.trim()
.split('\n')
.map(line => normalizePath(line.split(' ')[1]))
.map((line: string) => normalizePath(line.split(' ')[1]))
}
export const gitSubmoduleDiffSHA = async ({
@@ -389,7 +389,7 @@ export const gitRenamedFiles = async ({
.trim()
.split('\n')
.filter(Boolean)
.map(line => {
.map((line: string) => {
core.debug(`Renamed file: ${line}`)
const [, oldPath, newPath] = line.split('\t')
if (isSubmodule) {
@@ -459,7 +459,7 @@ export const gitDiff = async ({
const files = stdout
.split('\n')
.filter(Boolean)
.map(p => {
.map((p: string) => {
if (isSubmodule) {
return normalizePath(path.join(parentDir, p))
}

View File

@@ -360,17 +360,17 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"
"@eslint/js@8.41.0":
version "8.41.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.41.0.tgz#080321c3b68253522f7646b55b577dd99d2950b3"
integrity sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==
"@eslint/js@8.42.0":
version "8.42.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.42.0.tgz#484a1d638de2911e6f5a30c12f49c7e4a3270fb6"
integrity sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw==
"@github/browserslist-config@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@github/browserslist-config/-/browserslist-config-1.0.0.tgz#952fe6da3e6b8ed6a368f3a1a08a9d2ef84e8d04"
integrity sha512-gIhjdJp/c2beaIWWIlsXdqXVRUz3r2BxBCpfz/F3JXHvSAQ1paMYjLH+maEATtENg+k5eLV7gA+9yPp762ieuw==
"@humanwhocodes/config-array@^0.11.8":
"@humanwhocodes/config-array@^0.11.10":
version "0.11.10"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2"
integrity sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==
@@ -1171,9 +1171,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
caniuse-lite@^1.0.30001489:
version "1.0.30001492"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001492.tgz#4a06861788a52b4c81fd3344573b68cc87fe062b"
integrity sha512-2efF8SAZwgAX1FJr87KWhvuJxnGJKOnctQa8xLOskAXNXq8oiuqgl6u1kk3fFpsp3GgvzlRjiK1sl63hNtFADw==
version "1.0.30001494"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001494.tgz#3e56e04a48da7a79eae994559eb1ec02aaac862f"
integrity sha512-sY2B5Qyl46ZzfYDegrl8GBCzdawSLT4ThM9b9F+aDYUrAG2zCOyMbd2Tq34mS1g4ZKBfjRlzOohQMxx28x6wJg==
chalk@^2.0.0:
version "2.4.2"
@@ -1372,9 +1372,9 @@ doctrine@^3.0.0:
esutils "^2.0.2"
electron-to-chromium@^1.4.411:
version "1.4.417"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.417.tgz#a0c7eb992e68287fa50c8da5a5238b01f20b9a82"
integrity sha512-8rY8HdCxuSVY8wku3i/eDac4g1b4cSbruzocenrqBlzqruAZYHjQCHIjC66dLR9DXhEHTojsC4EjhZ8KmzwXqA==
version "1.4.419"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.419.tgz#6fbea1f3abb65bf46e8ad874b5c1f0816ce2f8ce"
integrity sha512-jdie3RiEgygvDTyS2sgjq71B36q2cDSBfPlwzUyuOrfYTNoYWyBxxjGJV/HAu3A2hB0Y+HesvCVkVAFoCKwCSw==
emittery@^0.13.1:
version "0.13.1"
@@ -1660,16 +1660,16 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994"
integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==
eslint@8.41.0:
version "8.41.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.41.0.tgz#3062ca73363b4714b16dbc1e60f035e6134b6f1c"
integrity sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==
eslint@8.42.0:
version "8.42.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.42.0.tgz#7bebdc3a55f9ed7167251fe7259f75219cade291"
integrity sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A==
dependencies:
"@eslint-community/eslint-utils" "^4.2.0"
"@eslint-community/regexpp" "^4.4.0"
"@eslint/eslintrc" "^2.0.3"
"@eslint/js" "8.41.0"
"@humanwhocodes/config-array" "^0.11.8"
"@eslint/js" "8.42.0"
"@humanwhocodes/config-array" "^0.11.10"
"@humanwhocodes/module-importer" "^1.0.1"
"@nodelib/fs.walk" "^1.2.8"
ajv "^6.10.0"