mirror of
https://github.com/codecov/codecov-action.git
synced 2026-04-13 01:20:06 +00:00
feat: pass tokenless value as branch override
instead of only passing the tokenless branch value as an environment variable we want to pass it as the branch value to the CLI
This commit is contained in:
parent
abe5d5a96b
commit
c56aae1c00
4 changed files with 25 additions and 18 deletions
14
dist/index.js
vendored
14
dist/index.js
vendored
|
|
@ -32351,11 +32351,12 @@ const isPullRequestFromFork = () => {
|
|||
return (baseLabel.split(':')[0] !== headLabel.split(':')[0]);
|
||||
};
|
||||
const getToken = () => buildExec_awaiter(void 0, void 0, void 0, function* () {
|
||||
var _a;
|
||||
let token = core.getInput('token');
|
||||
if (!token && isPullRequestFromFork()) {
|
||||
core.info('==> Fork detected, tokenless uploading used');
|
||||
process.env['TOKENLESS'] = context.payload.pull_request.head.label;
|
||||
return Promise.resolve('');
|
||||
return [false, (_a = context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.head.label];
|
||||
}
|
||||
let url = core.getInput('url');
|
||||
const useOIDC = isTrue(core.getInput('use_oidc'));
|
||||
|
|
@ -32365,22 +32366,25 @@ const getToken = () => buildExec_awaiter(void 0, void 0, void 0, function* () {
|
|||
}
|
||||
try {
|
||||
token = yield core.getIDToken(url);
|
||||
return token;
|
||||
return [true, token];
|
||||
}
|
||||
catch (err) {
|
||||
setFailure(`Codecov: Failed to get OIDC token with url: ${url}. ${err.message}`, true);
|
||||
}
|
||||
}
|
||||
return token;
|
||||
return [true, token];
|
||||
});
|
||||
const buildCommitExec = () => buildExec_awaiter(void 0, void 0, void 0, function* () {
|
||||
const commitParent = core.getInput('commit_parent');
|
||||
const gitService = getGitService();
|
||||
const overrideBranch = core.getInput('override_branch');
|
||||
let overrideBranch = core.getInput('override_branch');
|
||||
const overrideCommit = core.getInput('override_commit');
|
||||
const overridePr = core.getInput('override_pr');
|
||||
const slug = core.getInput('slug');
|
||||
const token = yield getToken();
|
||||
const [tokenAvailable, token] = yield getToken();
|
||||
if (!tokenAvailable) {
|
||||
overrideBranch = token;
|
||||
}
|
||||
const failCi = isTrue(core.getInput('fail_ci_if_error'));
|
||||
const workingDir = core.getInput('working-directory');
|
||||
const commitCommand = 'create-commit';
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue