Skip to content
Merged
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
with:
api-key: ${{ secrets.API_KEY }}
project-id: clle9fscu0000jf087maicxbc
run-group-name: CI TESTS
playwright-project-name: CI

- name: Print Output
id: output
Expand Down
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ inputs:
description: |-
The project ID to execute (v2 only).
Use this OR test-suite-id, not both.
run-group-name:
playwright-project-name:
description: |-
The Playwright project name to run (v2 only).
The Playwright project name(s) to run (v2 only).
Maps to the --project CLI flag.
Optional - if not provided, all projects will run.
run-group-name:
description: |-
Deprecated. Use playwright-project-name instead.
deprecationMessage:
'This input is deprecated. Please use playwright-project-name instead.'
env-overrides:
description: |-
A YAML string or JSON object containing environment variable overrides (v2 only).
Expand Down
19 changes: 11 additions & 8 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/github/github_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export async function upsertGitHubCommentV2(
runId: string,
githubToken: string,
resp: { result?: PlaywrightResultResponse; error?: boolean },
runGroupName?: string
playwrightProjectName?: string
) {
const octokit = getOctokit(githubToken);

Expand All @@ -187,7 +187,7 @@ export async function upsertGitHubCommentV2(

// prettier-ignore
const body = dedent`${commentIdentiifer}
# Stably Runner${runGroupName ? ` - [Run Group '${runGroupName}'](https://app.stably.ai/project/${projectId}/run-groups/${encodeURIComponent(runGroupName)})` : ''}
# Stably Runner${playwrightProjectName ? ` - [Playwright Project '${playwrightProjectName}'](https://app.stably.ai/project/${projectId}/playwright)` : ''}

Test Run Result: ${
resp.error
Expand Down
9 changes: 6 additions & 3 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type BaseInput = {
type V2Input = BaseInput & {
version: 'v2';
projectId: string;
runGroupName: string | undefined;
playwrightProjectName: string | undefined;
envOverrides: Record<string, string> | undefined;
};

Expand Down Expand Up @@ -50,7 +50,10 @@ export function parseInput(): ParsedInput {

// V2 inputs
const projectId = getInput('project-id');
const runGroupName = getInput('run-group-name').trim();
// playwright-project-name is the new preferred input, run-group-name is deprecated
const playwrightProjectNameInput = getInput('playwright-project-name').trim();
const runGroupNameInput = getInput('run-group-name').trim();
const playwrightProjectName = playwrightProjectNameInput || runGroupNameInput;
const envOverridesJson = getInput('env-overrides');
const envOverrides = envOverridesJson
? (parseObjectInput('env-overrides', envOverridesJson) as Record<
Expand Down Expand Up @@ -133,7 +136,7 @@ export function parseInput(): ParsedInput {
? {
version: 'v2' as const,
projectId,
runGroupName: runGroupName || undefined,
playwrightProjectName: playwrightProjectName || undefined,
envOverrides
}
: {
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async function runV1({
async function runV2({
apiKey,
projectId,
runGroupName,
playwrightProjectName,
githubComment,
githubToken,
runInAsyncMode,
Expand All @@ -124,7 +124,7 @@ async function runV2({
projectId,
apiKey,
options: {
runGroupName,
playwrightProjectName,
envOverrides
}
});
Expand Down Expand Up @@ -163,7 +163,7 @@ async function runV2({
{
result: runResult
},
runGroupName
playwrightProjectName
);
}
} catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions src/stably/api/playwright-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function startPlaywrightRun({
projectId: string;
apiKey: string;
options: {
runGroupName?: string;
playwrightProjectName?: string;
envOverrides?: Record<string, string>;
};
}): Promise<PlaywrightRunResponse> {
Expand All @@ -76,7 +76,7 @@ export async function startPlaywrightRun({
]);

const body = {
runGroupName: options.runGroupName,
playwrightProjectName: options.playwrightProjectName,
envOverrides: options.envOverrides
};

Expand Down
Loading