mirror of
https://gitea.com/actions/dorny-paths-filter.git
synced 2026-08-22 00:23:18 +01:00
fix: scope base-ignored warning to API path (#319)
This commit is contained in:
9
dist/index.js
vendored
9
dist/index.js
vendored
@@ -659,11 +659,11 @@ async function getChangedFiles(token, base, ref, initialFetchDepth) {
|
||||
if (ref) {
|
||||
core.warning(`'ref' input parameter is ignored when action is triggered by pull request event`);
|
||||
}
|
||||
if (base) {
|
||||
core.warning(`'base' input parameter is ignored when action is triggered by pull request event`);
|
||||
}
|
||||
const pr = github.context.payload.pull_request;
|
||||
if (token) {
|
||||
if (base) {
|
||||
core.warning(`'base' input parameter is ignored when action is triggered by pull request event and 'token' is provided - set token: '' to detect changes using git diff against 'base'`);
|
||||
}
|
||||
return await getChangedFilesFromApi(token, pr);
|
||||
}
|
||||
if (github.context.eventName === 'pull_request_target') {
|
||||
@@ -673,6 +673,9 @@ async function getChangedFiles(token, base, ref, initialFetchDepth) {
|
||||
throw new Error(`'token' input parameter is required if action is triggered by 'pull_request_target' event`);
|
||||
}
|
||||
core.info('GitHub token is not available - changes will be detected using git diff');
|
||||
if (base) {
|
||||
core.info(`Using base '${base}' instead of the pull request base`);
|
||||
}
|
||||
const baseSha = (_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.base.sha;
|
||||
const defaultBranch = (_b = github.context.payload.repository) === null || _b === void 0 ? void 0 : _b.default_branch;
|
||||
const currentRef = await git.getCurrentRef();
|
||||
|
||||
Reference in New Issue
Block a user