Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb committed Oct 22, 2023
1 parent 6985a53 commit 47fc585
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import * as constants from './constants';
// };

export type PushImagesInput = {
githubToken: string;
runId: number;
result: CompareOutput;
branch: string;
Expand Down Expand Up @@ -136,7 +137,7 @@ export interface EnvironmentVariables {
/**
* The GITHUB_TOKEN secret
*/
GITHUB_TOKEN?: string;
// GITHUB_TOKEN?: string;
/**
* Set to "true" to avoid pushing commits that don't change any files.
*
Expand Down Expand Up @@ -272,10 +273,10 @@ const genConfig = (input: PushImagesInput): Config => {

// Determine the type of URL
// if (repo === REPO_SELF) {
if (!env.GITHUB_TOKEN) throw new Error('GITHUB_TOKEN must be specified when REPO == self');
if (!input.githubToken) throw new Error('GITHUB_TOKEN must be specified when REPO == self');
if (!env.GITHUB_REPOSITORY) throw new Error('GITHUB_REPOSITORY must be specified when REPO == self');

const url = `https://x-access-token:${env.GITHUB_TOKEN}@github.com/${env.GITHUB_REPOSITORY}.git`;
const url = `https://x-access-token:${input.githubToken}@github.com/${env.GITHUB_REPOSITORY}.git`;
const config: Config = {
repo: url,
branch,
Expand Down
1 change: 1 addition & 0 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export const run = async (event: Event, runId: number, sha: string, client: Clie
// expectedDir: path.join(workspace(), constants.EXPECTED_DIR_NAME),
// diffDir: path.join(workspace(), constants.DIFF_DIR_NAME),
await pushImages({
githubToken: config.githubToken,
runId,
result,
branch: 'reg',
Expand Down

0 comments on commit 47fc585

Please sign in to comment.