Skip to content

Commit

Permalink
Quiet feature
Browse files Browse the repository at this point in the history
Some of the stderr, stdout, info & groupings can be a little noisy for some users and use cases.
This feature allows for a option to be passed 'quiet: true' this would significantly reduce the noise.

There will still be output that lets the user know Wrangler Installed and Wrangler Action completed successfully.
Any failure status will still be output to the user as well, to prevent silent failures.

resolves #142
  • Loading branch information
JacobMGEvans committed Aug 16, 2023
1 parent 36ba30d commit 3f40637
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 73 deletions.
12 changes: 12 additions & 0 deletions .changeset/gold-moose-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"wrangler-action": minor
---

feat: Quiet mode
Some of the stderr, stdout, info & groupings can be a little noisy for some users and use cases.
This feature allows for a option to be passed 'quiet: true' this would significantly reduce the noise.

There will still be output that lets the user know Wrangler Installed and Wrangler Action completed successfully.
Any failure status will still be output to the user as well, to prevent silent failures.

resolves #142
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --dry-run

- name: Only build app w/ quiet enabled
uses: ./
with:
quiet: true
workingDirectory: "./test/base"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --dry-run

# START Setup and teardown of Worker Environment Tests
- name: Environment support
uses: ./
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/workerHealthCheck.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ function workerHealthCheck() {

const response = buffer.toString();

response.includes("OK")
? console.log(`Status: Worker is up! Secrets: ${response}`)
: console.log(`Worker is down!`);
if (response.includes("OK")) {
console.log(`Status: Worker is up! Response: ${response}`);
} else {
throw new Error(`Worker is down! Response: ${response}`);
}

return response;
}
Expand Down
1 change: 1 addition & 0 deletions action-env-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
process.env.INPUT_QUIET ??= "false";
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ inputs:
accountId:
description: "Your Cloudflare Account ID"
required: false

quiet:
description: "Supresses output from Wrangler commands, defaults to `false`"
required: false
default: "false"
environment:
description: "The environment you'd like to deploy your Workers project to - must be defined in wrangler.toml"
workingDirectory:
Expand Down
114 changes: 57 additions & 57 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@cloudflare/workers-types": "^4.20230710.1",
"@types/node": "^20.4.2",
"@cloudflare/workers-types": "^4.20230814.0",
"@types/node": "^20.5.0",
"@vercel/ncc": "^0.36.1",
"prettier": "^3.0.0",
"prettier": "^3.0.1",
"typescript": "^5.1.6",
"vitest": "^0.33.0"
"vitest": "^0.34.1"
}
}
Loading

0 comments on commit 3f40637

Please sign in to comment.