Skip to content

Commit

Permalink
Add uploadMetadata option to GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Oct 13, 2023
1 parent 32815e8 commit 9b5091b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
19 changes: 2 additions & 17 deletions action-src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const getBuildInfo = (event: typeof context) => {
}
case 'workflow_run': {
const { repository } = event.payload;
// eslint-disable-next-line @typescript-eslint/naming-convention
const { head_sha, head_branch } = event.payload.workflow_run;

return {
Expand Down Expand Up @@ -76,22 +75,6 @@ const getBuildInfo = (event: typeof context) => {
}
};

interface Output {
code: number;
url: string;
buildUrl: string;
storybookUrl: string;
specCount: number;
componentCount: number;
testCount: number;
changeCount: number;
errorCount: number;
interactionTestFailuresCount: number;
actualTestCount: number;
actualCaptureCount: number;
inheritedCaptureCount: number;
}

async function run() {
const { sha, branch, slug, mergeCommit } = getBuildInfo(context) || {};
if (!sha || !branch || !slug) return;
Expand Down Expand Up @@ -123,6 +106,7 @@ async function run() {
const storybookConfigDir = getInput('storybookConfigDir');
const traceChanged = getInput('traceChanged');
const untraced = getInput('untraced');
const uploadMetadata = getInput('uploadMetadata');
const workingDir = getInput('workingDir') || getInput('workingDirectory');
const zip = getInput('zip');
const junitReport = getInput('junitReport');
Expand Down Expand Up @@ -165,6 +149,7 @@ async function run() {
storybookConfigDir: maybe(storybookConfigDir),
traceChanged: maybe(traceChanged),
untraced: maybe(untraced),
uploadMetadata: maybe(uploadMetadata, false),
zip: maybe(zip, false),
junitReport: maybe(junitReport, false),
},
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ inputs:
untraced:
description: 'Disregard these files and their dependencies when tracing dependent stories for TurboSnap'
required: false
uploadMetadata:
description: 'Upload Chromatic metadata files as part of the published Storybook'
required: false
workingDir:
description: 'Working directory for the package.json file'
required: false
Expand Down
2 changes: 1 addition & 1 deletion node-src/lib/parseArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function parseArgs(argv: string[]) {
--list List available stories. This requires running a full build.
--no-interactive Don't ask interactive questions about your setup and don't overwrite output. Always true in non-TTY environments.
--trace-changed [mode] Print dependency trace for changed files to affected story files. Set to "expanded" to list individual modules. Requires --only-changed.
--upload-metadata Upload Chromatic metadata files as part of the published Storybook. Includes chromatic-diagnostics.json, chromatic.log, and storybook-build.log
--upload-metadata Upload Chromatic metadata files as part of the published Storybook. Includes chromatic-diagnostics.json, chromatic.log, and storybook-build.log, among others.
Deprecated options
--app-code <token> Renamed to --project-token.
Expand Down

0 comments on commit 9b5091b

Please sign in to comment.