Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth11 committed Sep 26, 2024
1 parent 22d6828 commit ee21464
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 6 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ export async function run(): Promise<void> {
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",
Expand Down

0 comments on commit ee21464

Please sign in to comment.