fix: scope base-ignored warning to API path (#319)

This commit is contained in:
Sascha Bratton
2026-07-02 21:33:01 -04:00
committed by GitHub
parent cae9006b65
commit 9af6e5a9d0
3 changed files with 19 additions and 8 deletions

9
dist/index.js vendored
View File

@@ -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();