Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yaml
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:
Comment on lines +15 to +31

Check warning

Code 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: {}

Copilot Autofix

AI 2 months ago

To address this security issue, add a permissions block to the workflow to restrict the GITHUB_TOKEN permissions. 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 likely contents: read, allowing it to check out code. This can be set at the workflow root (so it applies to all jobs) by inserting

permissions:
  contents: read

between 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.


Suggested changeset 1
.github/workflows/deploy.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml
--- a/.github/workflows/deploy.yaml
+++ b/.github/workflows/deploy.yaml
@@ -1,5 +1,8 @@
 run-name: Deploy ${{ github.ref_name }}
 
+permissions:
+  contents: read
+
 on:
   push:
     branches:
EOF
@@ -1,5 +1,8 @@
run-name: Deploy ${{ github.ref_name }}

permissions:
contents: read

on:
push:
branches:
Copilot is powered by AI and may make mistakes. Always verify output.
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 warning

Code 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 Autofix

AI 2 months ago

To resolve this problem, you should add a permissions block at either the workflow root (to apply to all jobs) or to jobs individually if they need distinct privileges. The most secure approach is to apply the minimum permissions required by the workflow as a whole—typically contents: read is sufficient for most deploy workflows, unless explicit interactions with issues, pull requests, or other resources are needed. In your workflow, there are no steps that require write access to the repository, so the minimal starting point is appropriate. Therefore, you should add the following directly beneath the top-level fields (e.g., after run-name or before/on) in .github/workflows/deploy.yaml:

permissions:
  contents: read

No imports or additional dependencies are required.

Suggested changeset 1
.github/workflows/deploy.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml
--- a/.github/workflows/deploy.yaml
+++ b/.github/workflows/deploy.yaml
@@ -1,4 +1,6 @@
 run-name: Deploy ${{ github.ref_name }}
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
run-name: Deploy ${{ github.ref_name }}
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
21 changes: 0 additions & 21 deletions .github/workflows/deploy_gcp.yaml

This file was deleted.

94 changes: 0 additions & 94 deletions .github/workflows/docker_publish_gcp.yaml

This file was deleted.

68 changes: 0 additions & 68 deletions .github/workflows/ecs_prod.yml

This file was deleted.

18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

19 changes: 19 additions & 0 deletions wrangler.toml
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 },
]