Skip to content

Conversation

@nitinmittal23
Copy link
Contributor

No description provided.

py-zoid and others added 28 commits December 6, 2024 17:16
… SPEC-889-github-workflow-for-docker-publish
…r-docker-publish

GCP docker publish images to artifact repository
…ment

fix(NO-JIRA): update wrangler pattern deployment
…ment

fix(NO-JIRA): reverting the change and correcting directory
…ment

fix(NO-JIRA): serve listRegistry.json at root
…ment

fix(NO-JIRA): fix to handle options request and root access
…pts-update

fix(NO-JIRA): handle cors issue with wildcard matching for domain
add: custom usdc for xlayer mainnet
Comment on lines +15 to +31
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:

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 about 1 month ago

To fix the problem, we should set a permissions: block at the workflow root (above jobs:), 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:

permissions:
  contents: read

This change goes at the root level, after run-name and before on:. No other code changes are required. If future job steps require extra permissions, the block can be amended or overridden at job level.


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.
Comment on lines +32 to +44
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 }}

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 about 1 month ago

The best way to address this issue is to add an explicit permissions: block to the workflow or relevant job. Since nothing in the provided workflow appears to need write access via GITHUB_TOKEN, we should set the minimal required permissions, which is typically contents: read (necessary for actions/checkout and similar read-only operations). Adding this at the top level (root of the workflow file) ensures all jobs inherit this minimal permission, unless overridden per-job. This requires adding:

permissions:
  contents: read

immediately after the run-name: ... line and before the on: block. No imports or definitions are needed for this change, just an insertion in the workflow YAML.


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.
@brkbrk700
Copy link

L"scripts": {
"build": "your-build-command"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants