From ee214648744e7d01e2e3237969152faab5ef5d25 Mon Sep 17 00:00:00 2001 From: Siddharth Parmar Date: Thu, 26 Sep 2024 20:09:32 +0530 Subject: [PATCH] update readme --- README.md | 9 +++++---- src/main.ts | 8 ++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 68c0ee6..87f9c0c 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,16 @@ - name: Dispatch for tests uses: empirical-run/dispatch-action@main with: + environment: production # or staging or mobile build-url: ${{ steps.prev-step.outputs.url }} - platform: web # or android, ios ``` Supported inputs + +- [x] environment: **Required** input, to specify which environment to run the tests against. Configure environments by contacting us. - [x] build-url: **Required** input, for the URL of the application build - - For web, this points to a URL of the deployment (e.g. `https://staging.your-app.com`) - - For mobile, this points to a downloadable file, ending in `.apk`, `.aab` or `.ipa` -- [x] platform: **Optional** input, to specify one of the supported platforms: `web`, `android`, or `ios`. Default is `web` + - For web, this points to a URL of the deployment (e.g. `https://staging.your-app.com`) + - For mobile, this points to a downloadable file, ending in `.apk`, `.aab` or `.ipa` > Note that this Action only supports whitelisted GitHub organizations. To get access, contact us. diff --git a/src/main.ts b/src/main.ts index d790354..d3a8b53 100644 --- a/src/main.ts +++ b/src/main.ts @@ -53,10 +53,14 @@ export async function run(): Promise { console.log(`Warning: slack-webhook-url is not a supported input, and will be ignored.`) } const platform: string = core.getInput('platform'); - if (platform && !isValidPlatform(platform)) { - core.setFailed(`Invalid config: platform must be one of web, android or ios.`) + if (platform) { + console.warn(`Warning: platform is a deprecated input, you should use environment instead.`) } + const environment = core.getInput('environment'); + if (!platform && !environment) { + core.setFailed(`Missing config parameter: either of "environment" or "platform" (deprecated) needs to passed`) + } const response = await fetch("https://dispatch.empirical.run/v1/trigger", { method: "POST",