Skip to content

chore(CI): new docker image repo#237

Merged
PaiJi merged 2 commits intomainfrom
chore/push-image-to-ccr
Jun 27, 2025
Merged

chore(CI): new docker image repo#237
PaiJi merged 2 commits intomainfrom
chore/push-image-to-ccr

Conversation

@PaiJi
Copy link
Copy Markdown
Member

@PaiJi PaiJi commented Jun 27, 2025

No description provided.

Copilot AI review requested due to automatic review settings June 27, 2025 17:06
@PaiJi PaiJi merged commit 369ffad into main Jun 27, 2025
2 of 4 checks passed
@PaiJi PaiJi deleted the chore/push-image-to-ccr branch June 27, 2025 17:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates several dependency versions in package.json and introduces a new GitHub Actions workflow for building and pushing a Docker image to a new repository.

  • Updated dependency versions in package.json
  • Added a new workflow file (.github/workflows/build-cn-image.yml) for building the CN Docker image

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
package.json Updated dependency version numbers
.github/workflows/build-cn-image.yml New CI workflow for building and pushing Docker images

echo XATA_API_KEY="$XATA_API_KEY" >> .env
echo SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN" >> .env
echo NEXT_PUBLIC_ENABLE_TRACK="$ENABLE_TRACK" >> .env
echo NEXT_PUBLIC_REGION="$NEXT_PUBLIC_REGION" >>.env
Copy link

Copilot AI Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a space between the redirection operator '>>' and the filename for consistency with similar echo commands in the same step.

Suggested change
echo NEXT_PUBLIC_REGION="$NEXT_PUBLIC_REGION" >>.env
echo NEXT_PUBLIC_REGION="$NEXT_PUBLIC_REGION" >> .env

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +53
runs-on: ubuntu-latest
environment: Prod-CN
env:
XATA_API_KEY: ${{ secrets.XATA_API_KEY }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
ENABLE_TRACK: ${{ vars.ENABLE_TRACK }}
NEXT_PUBLIC_REGION: ${{ vars.NEXT_PUBLIC_REGION }}
NEXT_PUBLIC_SENTRY_DSN: ${{vars.NEXT_PUBLIC_SENTRY_DSN}}
NEXT_PUBLIC_WEBSITE_URL: ${{vars.NEXT_PUBLIC_WEBSITE_URL}}
FEC_API_TOKEN: ${{vars.FEC_API_TOKEN}}
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Login to Qcloud Hongkong Container Registry
uses: docker/login-action@v3
with:
registry: hkccr.ccs.tencentyun.com
username: "${{ vars.QCLOUD_REGISTRY_USERNAME }}"
password: "${{ secrets.QCLOUD_REGISTRY_PASSWORD }}"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Create Env
run: |
touch .env
echo XATA_API_KEY="$XATA_API_KEY" >> .env
echo SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN" >> .env
echo NEXT_PUBLIC_ENABLE_TRACK="$ENABLE_TRACK" >> .env
echo NEXT_PUBLIC_REGION="$NEXT_PUBLIC_REGION" >>.env
echo NEXT_PUBLIC_SENTRY_DSN="$NEXT_PUBLIC_SENTRY_DSN" >>.env
echo NEXT_PUBLIC_WEBSITE_URL="$NEXT_PUBLIC_WEBSITE_URL" >>.env
echo FEC_API_TOKEN="$FEC_API_TOKEN" >>.env

- name: Build and push
uses: docker/build-push-action@v6
timeout-minutes: 5
with:
context: .
push: true
tags: |
hkccr.ccs.tencentyun.com/furrycons/frontend:latest
hkccr.ccs.tencentyun.com/furrycons/frontend:${{ github.sha }}

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 10 months ago

To fix the issue, we will add a permissions block to the workflow file. This block will explicitly define the minimal permissions required for the workflow to function correctly. Since the workflow primarily interacts with Docker and does not modify repository contents, we will set contents: read as the permission level. This ensures that the workflow has read-only access to the repository contents, which is sufficient for its operations.

The permissions block will be added at the root level of the workflow file, applying to all jobs within the workflow.

Suggested changeset 1
.github/workflows/build-cn-image.yml

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/build-cn-image.yml b/.github/workflows/build-cn-image.yml
--- a/.github/workflows/build-cn-image.yml
+++ b/.github/workflows/build-cn-image.yml
@@ -7,2 +7,5 @@
 
+permissions:
+  contents: read
+
 jobs:
EOF
@@ -7,2 +7,5 @@

permissions:
contents: read

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

3 participants