-
Notifications
You must be signed in to change notification settings - Fork 160
ci: host through Cloudflare #766
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
Changes from all commits
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 2 months ago To resolve this problem, you should add a permissions:
contents: readNo imports or additional dependencies are required.
Suggested changeset
1
.github/workflows/deploy.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name = "polygon-token-list" | ||
| compatibility_date = "2024-12-30" | ||
| placement = { mode = "smart" } | ||
| preview_urls = false | ||
| send_metrics = false | ||
| workers_dev = false | ||
|
|
||
| [assets] | ||
| directory = "build/tokenlists" | ||
|
|
||
| [env.staging] | ||
| routes = [ | ||
| { pattern = "api-polygon-tokens.staging.polygon.technology", custom_domain = true }, | ||
| ] | ||
|
|
||
| [env.production] | ||
| routes = [ | ||
| { pattern = "api-polygon-tokens.polygon.technology", custom_domain = true }, | ||
| ] |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 2 months ago
To address this security issue, add a
permissionsblock to the workflow to restrict theGITHUB_TOKENpermissions. Since the workflow jobs shown do not perform any write operations to the repository (no pushes, issue/PR management, or artifact storage), the minimal permission required is likelycontents: read, allowing it to check out code. This can be set at the workflow root (so it applies to all jobs) by insertingbetween the top metadata and the
on:block. This edit sets the least privilege and follows GitHub's official recommendation. No new methods, imports, or definitions are needed.