Merge pull request #315 from Alexkuva/patch-1

chore: Add environment parameter for worker secret
This commit is contained in:
Jacob Hands 2024-11-19 14:34:40 -06:00 committed by GitHub
commit d44c80928a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,7 +76,7 @@ jobs:
workingDirectory: "subfoldername" workingDirectory: "subfoldername"
``` ```
[Worker secrets](https://developers.cloudflare.com/workers/tooling/wrangler/secrets/) can optionally be passed in via `secrets` as a string of names separated by newlines. Each secret name must match the name of an environment variable specified in the `env` field. This creates or replaces the value for the Worker secret using the `wrangler secret put` command. [Worker secrets](https://developers.cloudflare.com/workers/tooling/wrangler/secrets/) can optionally be passed in via `secrets` as a string of names separated by newlines. Each secret name must match the name of an environment variable specified in the `env` field. This creates or replaces the value for the Worker secret using the `wrangler secret put` command. It's also possible to specify worker environment using environment parameter.
```yaml ```yaml
jobs: jobs:
@ -85,6 +85,7 @@ jobs:
uses: cloudflare/wrangler-action@v3 uses: cloudflare/wrangler-action@v3
with: with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
environment: production
secrets: | secrets: |
SECRET1 SECRET1
SECRET2 SECRET2