-
Notifications
You must be signed in to change notification settings - Fork 169
dev to master #776
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
base: master
Are you sure you want to change the base?
dev to master #776
Changes from all commits
a309dc1
bdbbbe0
187560f
a9c4195
5094d93
4277e2c
641a633
eb26c59
160fae0
9b824dc
b9cc0d8
3c98016
4f0cfe6
c26170a
8c12642
25d7883
79e5add
4b66ca2
8111c54
6f34898
baf70c2
7a07363
27ca0d3
11460b1
ac74b6c
44398cc
8a9dc96
df2a780
7039332
16ea75a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | |||||||||||||||||||||||
| run-name: Deploy ${{ github.ref_name }} | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| on: | |||||||||||||||||||||||
| push: | |||||||||||||||||||||||
| branches: | |||||||||||||||||||||||
| - master | |||||||||||||||||||||||
| - dev | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| concurrency: | |||||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | |||||||||||||||||||||||
| cancel-in-progress: true | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||
| get-env: | |||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||
| outputs: | |||||||||||||||||||||||
| env: ${{ steps.set-env.outputs.env }} | |||||||||||||||||||||||
| steps: | |||||||||||||||||||||||
| - id: set-env | |||||||||||||||||||||||
| run: | | |||||||||||||||||||||||
| if [ "${{ github.ref_name }}" == "master" ]; then | |||||||||||||||||||||||
| export ENV=production | |||||||||||||||||||||||
| fi | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| if [ "${{ github.ref_name }}" == "dev" ]; then | |||||||||||||||||||||||
| export ENV=staging | |||||||||||||||||||||||
| fi | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| echo "env=$ENV" >> "$GITHUB_OUTPUT" | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| build-and-deploy: | |||||||||||||||||||||||
| needs: [get-env] | |||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||
| steps: | |||||||||||||||||||||||
| - uses: actions/checkout@v5 | |||||||||||||||||||||||
| - uses: actions/setup-node@v5 | |||||||||||||||||||||||
| - run: npm ci | |||||||||||||||||||||||
| - run: npm run build | |||||||||||||||||||||||
| - name: Deploy bundle | |||||||||||||||||||||||
| uses: cloudflare/wrangler-action@v3 | |||||||||||||||||||||||
| with: | |||||||||||||||||||||||
| environment: ${{ needs.get-env.outputs.env }} | |||||||||||||||||||||||
| apiToken: ${{ secrets.CF_WORKER_API_TOKEN }} | |||||||||||||||||||||||
| accountId: ${{ secrets.CF_WORKER_ACCOUNT_ID }} | |||||||||||||||||||||||
|
Comment on lines
+32
to
+44
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 7 months ago The best way to address this issue is to add an explicit permissions:
contents: readimmediately after the
Suggested changeset
1
.github/workflows/deploy.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| node_modules/ | ||
| build/ | ||
| .DS_STORE | ||
| .wrangler/ | ||
| src/wrangler_main.js |
This file was deleted.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 7 months ago
To fix the problem, we should set a
permissions:block at the workflow root (abovejobs:), thereby limiting the permissions of GITHUB_TOKEN for all jobs within the workflow. Since this deploy workflow only checks out code and runs deployment steps using secrets, it likely only needs read access to repository contents, and does not require write access to contents, issues, or pull-requests. The minimal recommended block is:This change goes at the root level, after
run-nameand beforeon:. No other code changes are required. If future job steps require extra permissions, the block can be amended or overridden at job level.