Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add quiet parameter to silence stdout #113

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
96081db
move gitignore and update for Node/TS environment
JacobMGEvans Jul 6, 2023
ce4ddc4
remove unnecessary package manifest
JacobMGEvans Jul 6, 2023
e67dad8
Add tsconfig for TS environment rewrite
JacobMGEvans Jul 6, 2023
d509fb3
Unit/integration testing prepared
JacobMGEvans Jul 6, 2023
8c213df
Update test worker to TypeScript and latest Wrangler config
JacobMGEvans Jul 6, 2023
540974e
Remove Docker deps & modify API for secrets and generic command
JacobMGEvans Jul 6, 2023
4a1ed8a
Remove shell job & update the jobs to use latest wrangler syntax
JacobMGEvans Jul 6, 2023
bc3231d
Initial TypeScript rewrite
JacobMGEvans Jul 6, 2023
559ad6d
config changes
JacobMGEvans Jul 6, 2023
5d33d6d
artifact functionality in test jobs
JacobMGEvans Jul 6, 2023
3cbb14b
TSC & Node setup
JacobMGEvans Jul 6, 2023
4dc616b
fix module resolution
JacobMGEvans Jul 7, 2023
c285749
TypeScript config
JacobMGEvans Jul 7, 2023
aa98957
interop not working
JacobMGEvans Jul 7, 2023
29cfa50
config fix
JacobMGEvans Jul 7, 2023
acdc718
Wrangler missing
JacobMGEvans Jul 7, 2023
3ad0d94
Fix execCommand function
JacobMGEvans Jul 7, 2023
3ebe54e
config fixes
JacobMGEvans Jul 7, 2023
15ea8ea
wrangler config fixes
JacobMGEvans Jul 7, 2023
70307ea
update jobs
JacobMGEvans Jul 7, 2023
df1a2a8
Remove Wrangler v1 support and email/token support
JacobMGEvans Jul 7, 2023
4c69be6
remove wrangler v1 & email/key support tests from self testing Action
JacobMGEvans Jul 7, 2023
f2b77d0
try commands
JacobMGEvans Jul 7, 2023
a13eabc
Try without exit 0
JacobMGEvans Jul 7, 2023
2e25eb4
change version installed by default
JacobMGEvans Jul 10, 2023
177dab5
Fix config construction
JacobMGEvans Jul 10, 2023
5026eaf
Early returns
JacobMGEvans Jul 10, 2023
80ea668
Fixed deploy yaml, improved action code, switched to pnpm
JacobMGEvans Jul 10, 2023
1c4ac02
Remove logs
JacobMGEvans Jul 10, 2023
bdc83a6
Fixed deploy.yml & updated wrangler action refactor further
JacobMGEvans Jul 11, 2023
326b72d
Secrets is utilizing Secrets Bulk, added Prettier, updated deploy.yml
JacobMGEvans Jul 14, 2023
b9fec9c
Fix the JSON creation
JacobMGEvans Jul 14, 2023
5e133e4
Using SpawnSync for now which forces sync behavior but uses bulk for …
JacobMGEvans Jul 14, 2023
f359464
secrets upload ignores outputs from Wrangler
JacobMGEvans Jul 14, 2023
4c78d85
Switch back to NPM due to additional CI overhead setup for now
JacobMGEvans Jul 14, 2023
d89ef83
lock and modules changed to NPM too
JacobMGEvans Jul 14, 2023
a43cba7
Update deploy.yml and remove Dockerfile
JacobMGEvans Jul 14, 2023
9e1318f
feat: add `quiet` parameter to silence stdout
winstxnhdw Jul 14, 2023
6c7a92f
feat: ignore stdout by default for `uploadSecrets`
winstxnhdw Jul 14, 2023
3c9b134
chore: add data type to `quiet` description
winstxnhdw Jul 14, 2023
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
118 changes: 45 additions & 73 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,63 @@
on: push
on: pull_request

jobs:
lint:
build_and_deploy_tests:
runs-on: ubuntu-latest
name: Lint
name: Build and Deploy Wrangler Action Tests
steps:
- uses: actions/checkout@v2
- name: Lint shell script
uses: azohra/[email protected]
with:
path: "entrypoint.sh"
build-only:
runs-on: ubuntu-latest
name: Only build the app
steps:
- uses: actions/checkout@v2
- name: Build app
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "latest"
cache: "npm"

- name: Install Dependencies
run: npm install

- name: Build Action
run: npm run build

- name: Only Build App
uses: ./
with:
workingDirectory: "./test"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: "test"
publish: false
secrets: |
SECRET1
SECRET2
preCommands: echo "*** pre commands ***"
postCommands: |
echo "*** post commands ***"
wrangler build
echo "******"
env:
SECRET1: ${{ secrets.SECRET1 }}
SECRET2: ${{ secrets.SECRET2 }}
publish:
runs-on: ubuntu-latest
name: Publish app
steps:
- uses: actions/checkout@v2
- name: Publish app
uses: ./
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
environment: "production"
workingDirectory: 'test'
publish_legacy_credentials:
runs-on: ubuntu-latest
name: Publish app with legacy credentials
steps:
- uses: actions/checkout@v2
- name: Publish app
uses: ./
with:
apiKey: ${{ secrets.CLOUDFLARE_API_KEY }}
email: ${{ secrets.CLOUDFLARE_EMAIL }}
environment: "production"
workingDirectory: 'test'
publish_hardcoded_wrangler_version:
runs-on: ubuntu-latest
name: Publish app with hardcoded Wrangler version
steps:
- uses: actions/checkout@v2
- name: Publish app
uses: ./
with:
apiKey: ${{ secrets.CLOUDFLARE_API_KEY }}
email: ${{ secrets.CLOUDFLARE_EMAIL }}
environment: "production"
wranglerVersion: '1.5.0'
workingDirectory: 'test'
publish_secrets:
runs-on: ubuntu-latest
name: Publish app with secrets
steps:
- uses: actions/checkout@v2
- name: Publish app
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
postCommands: npx wrangler deploy --dry-run && exit 0

- name: Deploy app w/ apiToken
uses: ./
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
environment: "production"
workingDirectory: "test"
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "./test"

- name: Deploy app w/ hardcoded Wrangler v2
uses: ./
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "2.20.0"
workingDirectory: "./test"

- name: Deploy app w/ secrets
uses: ./
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: "./test"
secrets: |
SECRET1
SECRET2
preCommands: echo "*** pre command ***"
preCommands: |
echo "*** pre commands ***"
echo "******"
postCommands: |
echo "*** post commands ***"
echo "******"
env:
SECRET1: ${{ secrets.SECRET1 }}
SECRET2: ${{ secrets.SECRET2 }}
SECRET2: ${{ secrets.SECRET2 }}
95 changes: 95 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
dist
.idea
.vscode

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
node_modules
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release


# Moved from ./templates for ignoring all locks in templates
templates/**/*-lock.*
templates/**/*.lock

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

23 changes: 10 additions & 13 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ name: "Deploy to Cloudflare Workers with Wrangler"
branding:
icon: "upload-cloud"
color: "orange"
description: "Deploy your Cloudflare Workers and Pages projects from GitHub using Wrangler"
description: "Deploy your Cloudflare Projects from GitHub using Wrangler"
runs:
using: "docker"
image: "Dockerfile"
using: "node16"
main: "dist/index.js"
inputs:
apiKey:
description: "(Legacy) Your Cloudflare API Key"
required: false
email:
description: "(Legacy) Your Cloudflare Email"
required: false
apiToken:
description: "Your Cloudflare API Token"
required: false
Expand All @@ -29,14 +23,17 @@ inputs:
description: "The version of Wrangler you'd like to use to publish your Workers project"
required: false
secrets:
description: "A new line deliminated string of environment variable names that should be configured as Worker secrets"
description: "Multiline or JSON - string of environment variable names that should be configured as Worker secrets"
required: false
preCommands:
description: "Commands to execute before publishing the Workers project"
required: false
postCommands:
description: "Commands to execute after publishing the Workers project"
required: false
command:
description: "The Wrangler command you wish to run. For example: \"publish\" - this will publish your Worker"
required: false
commands:
description: "Multiline - A generic command passthrough for any Wrangler commands."
required: false
quiet:
description: "Boolean - Suppress standard output from Wrangler commands"
required: false
Loading