Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default async (pluginConfig, context) => {
const { encodedProjectPath, projectApiUrl } = getProjectContext(context, gitlabUrl, gitlabApiUrl, repositoryUrl);

const apiOptions = {
headers: { [tokenHeader]: gitlabToken },
headers: { tokenHeader: gitlabToken },
retry: {
limit: retryLimit,
statusCodes: retryStatusCodes,
Expand Down
2 changes: 1 addition & 1 deletion lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default async (pluginConfig, context) => {
const encodedGitTag = encodeURIComponent(gitTag);
const apiOptions = {
headers: {
[tokenHeader]: gitlabToken,
tokenHeader: gitlabToken,
},
hooks: {
beforeError: [
Expand Down
2 changes: 1 addition & 1 deletion lib/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default async (pluginConfig, context) => {
} = resolveConfig(pluginConfig, context);
const { projectApiUrl } = getProjectContext(context, gitlabUrl, gitlabApiUrl, repositoryUrl);
const apiOptions = {
headers: { [tokenHeader]: gitlabToken },
headers: { tokenHeader: gitlabToken },
retry: { limit: retryLimit, statusCodes: retryStatusCodes },
};

Expand Down
4 changes: 2 additions & 2 deletions lib/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export default async (pluginConfig, context) => {
try {
if (useJobToken) {
logger.log("Using Job Token for authentication. Some functionality may be disabled.");
await got.get(urlJoin(projectApiUrl, "releases"), { headers: { [tokenHeader]: gitlabToken } });
await got.get(urlJoin(projectApiUrl, "releases"), { headers: { tokenHeader: gitlabToken } });
} else {
({
permissions: { project_access: projectAccess, group_access: groupAccess },
} = await got
.get(projectApiUrl, {
headers: { [tokenHeader]: gitlabToken },
headers: { tokenHeader: gitlabToken },
...proxy,
})
.json());
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/mock-gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export default function (
const tokenHeader = useJobToken ? "JOB-TOKEN" : "Private-Token";
const token = useJobToken ? env.CI_JOB_TOKEN : gitlabToken;

return nock(urlJoin(gitlabUrl, gitlabApiPathPrefix), { reqheaders: { [tokenHeader]: token } });
return nock(urlJoin(gitlabUrl, gitlabApiPathPrefix), { reqheaders: { tokenHeader: token } });
}