forked from cloudflare/wrangler-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "(feat): Use existing wrangler installation when appro…
…priate (cloudflare#235)"" This reverts commit 2d275a8.
- Loading branch information
1 parent
b84268f
commit aec9bf9
Showing
35 changed files
with
328 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name = "wrangler-action-test-build-quiet" | ||
main = "./index.ts" | ||
compatibility_date = "2023-07-07" | ||
workers_dev = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
type Env = { | ||
SECRET1?: string; | ||
SECRET2?: string; | ||
}; | ||
|
||
export default { | ||
fetch(request: Request, env: Env) { | ||
const url = new URL(request.url); | ||
|
||
if (url.pathname === "/secret-health-check") { | ||
const { SECRET1, SECRET2 } = env; | ||
|
||
if (SECRET1 !== "SECRET_1_VALUE" || SECRET2 !== "SECRET_2_VALUE") { | ||
throw new Error("SECRET1 or SECRET2 is not defined"); | ||
} | ||
|
||
return new Response("OK"); | ||
} | ||
|
||
return Response.json({ | ||
...request, | ||
headers: Object.fromEntries(request.headers), | ||
}); | ||
}, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "wrangler-action-test", | ||
"license": "MIT", | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name = "wrangler-action-test" | ||
name = "wrangler-action-test-only-build" | ||
main = "./index.ts" | ||
compatibility_date = "2023-07-07" | ||
workers_dev = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
type Env = { | ||
SECRET1?: string; | ||
SECRET2?: string; | ||
}; | ||
|
||
export default { | ||
fetch(request: Request, env: Env) { | ||
const url = new URL(request.url); | ||
|
||
if (url.pathname === "/secret-health-check") { | ||
const { SECRET1, SECRET2 } = env; | ||
|
||
if (SECRET1 !== "SECRET_1_VALUE" || SECRET2 !== "SECRET_2_VALUE") { | ||
throw new Error("SECRET1 or SECRET2 is not defined"); | ||
} | ||
|
||
return new Response("OK"); | ||
} | ||
|
||
return Response.json({ | ||
...request, | ||
headers: Object.fromEntries(request.headers), | ||
}); | ||
}, | ||
}; |
18 changes: 18 additions & 0 deletions
18
test/pre-installed-wrangler/mock_packages/wrangler/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env node | ||
"use strict"; | ||
|
||
const args = Array.from(process.argv); | ||
const command = args.pop(); | ||
switch (command) { | ||
case "--version": | ||
console.log(` | ||
⛅️ wrangler 1.1.1 (update available 1.2.3) | ||
------------------------------------------`); | ||
process.exit(0); | ||
case "action-test": | ||
console.log("Test successful."); | ||
process.exit(0); | ||
default: | ||
console.error("Invalid command"); | ||
process.exit(1); | ||
} |
7 changes: 7 additions & 0 deletions
7
test/pre-installed-wrangler/mock_packages/wrangler/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"private": true, | ||
"name": "wrangler", | ||
"version": "1.1.1", | ||
"main": "index.js", | ||
"bin": "index.js" | ||
} |
Oops, something went wrong.