Skip to content

Commit

Permalink
show status for static hosting build (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhizor authored Jan 4, 2023
1 parent e89b284 commit 573c64e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion action/__tests__/plugins/staticHosting/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ describe('static hosting plugin', () => {
ghRunId: 1000,
ghRunNumber: 2000,
ghRunAttempt: 1,
ghToken: 'token'
ghToken: 'token',
stepsSucceeded: true
};

let stdoutWriteSpy: ReturnType<ModuleMocker['spyOn']>;
Expand Down
8 changes: 5 additions & 3 deletions action/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28838,7 +28838,7 @@ var staticHosting_plugin_awaiter = (undefined && undefined.__awaiter) || functio



const runStaticHostingPlugin = (taskId, taskConfig, { ghToken, ghRepository: { repo, owner }, ghSha }, stoatConfigFileId) => staticHosting_plugin_awaiter(void 0, void 0, void 0, function* () {
const runStaticHostingPlugin = (taskId, taskConfig, { ghToken, ghRepository: { repo, owner }, ghSha, stepsSucceeded }, stoatConfigFileId) => staticHosting_plugin_awaiter(void 0, void 0, void 0, function* () {
core.info(`[${taskId}] Running static hosting plugin (stoat config ${stoatConfigFileId})`);
const currentDirectory = process.cwd();
core.info(`[${taskId}] Current directory: ${currentDirectory}`);
Expand Down Expand Up @@ -28873,7 +28873,8 @@ const runStaticHostingPlugin = (taskId, taskConfig, { ghToken, ghRepository: { r
taskId,
stoatConfigFileId,
ghToken,
hostingUrl
hostingUrl,
status: stepsSucceeded ? '✅' : '❌'
};
yield submitPartialConfig(taskId, 'static_hostings', requestBody);
});
Expand Down Expand Up @@ -29173,7 +29174,8 @@ function run(stoatConfig) {
ghRunId: parseInt(core.getInput('run_id')),
ghRunNumber: parseInt(core.getInput('run_number')),
ghRunAttempt: parseInt(core.getInput('run_attempt')),
ghToken: token
ghToken: token,
stepsSucceeded: stepsSucceeded
};
core.info('Loading template...');
const { owner, repo } = githubActionRun.ghRepository;
Expand Down
2 changes: 1 addition & 1 deletion action/dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion action/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ async function run(stoatConfig: any) {
ghRunId: parseInt(core.getInput('run_id')),
ghRunNumber: parseInt(core.getInput('run_number')),
ghRunAttempt: parseInt(core.getInput('run_attempt')),
ghToken: token
ghToken: token,
stepsSucceeded: stepsSucceeded
};

core.info('Loading template...');
Expand Down
5 changes: 3 additions & 2 deletions action/src/plugins/staticHosting/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createSignedUrl, uploadPath } from './helpers';
const runStaticHostingPlugin = async (
taskId: string,
taskConfig: StaticHostingPlugin,
{ ghToken, ghRepository: { repo, owner }, ghSha }: GithubActionRun,
{ ghToken, ghRepository: { repo, owner }, ghSha, stepsSucceeded }: GithubActionRun,
stoatConfigFileId: number
) => {
core.info(`[${taskId}] Running static hosting plugin (stoat config ${stoatConfigFileId})`);
Expand Down Expand Up @@ -52,7 +52,8 @@ const runStaticHostingPlugin = async (
taskId,
stoatConfigFileId,
ghToken,
hostingUrl
hostingUrl,
status: stepsSucceeded ? '✅' : '❌'
};
await submitPartialConfig<UploadStaticHostingRequest>(taskId, 'static_hostings', requestBody);
};
Expand Down
2 changes: 2 additions & 0 deletions action/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type GithubActionRun = {
ghRunNumber: number;
ghRunAttempt: number;
ghToken: string;
stepsSucceeded: boolean;
};

// These types are copied from src/common/types.ts.
Expand Down Expand Up @@ -92,6 +93,7 @@ export interface UploadPartialConfigResponse {

export interface UploadStaticHostingRequest extends UploadPartialConfigRequest {
hostingUrl: string;
status: string;
}

export interface UploadJsonRequest extends UploadPartialConfigRequest {
Expand Down

0 comments on commit 573c64e

Please sign in to comment.