From 104c2a01d56303b9f5fae22ccfca83fdf04ca452 Mon Sep 17 00:00:00 2001 From: LambdaYH Date: Mon, 7 Apr 2025 13:46:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9githubassets?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ghproxy/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ghproxy/main.go b/ghproxy/main.go index 27dfa8c..61ad003 100644 --- a/ghproxy/main.go +++ b/ghproxy/main.go @@ -32,6 +32,7 @@ var ( regexp.MustCompile(`^(?:https?://)?huggingface\.co(?:/spaces)?/([^/]+)/(.+)$`), regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co(?:/spaces)?/([^/]+)/([^/]+)(?:/(.*))?$`), regexp.MustCompile(`^(?:https?://)?download\.docker\.com/([^/]+)/.*\.(tgz|zip)$`), + regexp.MustCompile(`^(?:https?://)?([a-zA-Z0-9-]+\.)*githubassets\.com/([^/]+)/([^/]+)/.+?/.+$`), } httpClient *http.Client config *Config -- 2.49.1 From 9e9cdfdd2a210d19850c097c703a09de9b8a7394 Mon Sep 17 00:00:00 2001 From: LambdaYH Date: Mon, 7 Apr 2025 13:56:18 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96action=E5=AF=B9=E5=A4=A7?= =?UTF-8?q?=E5=86=99=E7=94=A8=E6=88=B7=E5=90=8D=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-ghcr.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-ghcr.yml b/.github/workflows/docker-ghcr.yml index 6bea7b7..c6649d3 100644 --- a/.github/workflows/docker-ghcr.yml +++ b/.github/workflows/docker-ghcr.yml @@ -38,14 +38,20 @@ jobs: - name: Set version from input run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + - name: Convert repository name to lowercase + run: | + # 将 github.repository 整体转换为小写 + REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') + echo "REPO_LOWER=$REPO_LOWER" >> $GITHUB_ENV + - name: Build and push Docker image run: | cd ghproxy docker buildx build --push \ --platform linux/amd64,linux/arm64 \ - --tag ghcr.io/${{ github.repository }}:${{ env.VERSION }} \ - --tag ghcr.io/${{ github.repository }}:latest \ + --tag ghcr.io/${{ env.REPO_LOWER }}:${{ env.VERSION }} \ + --tag ghcr.io/${{ env.REPO_LOWER }}:latest \ --build-arg VERSION=${{ env.VERSION }} \ -f Dockerfile . env: - GHCR_PUBLIC: true # 将镜像设置为公开 + GHCR_PUBLIC: true # 将镜像设置为公开 \ No newline at end of file -- 2.49.1 From 2a09c383953294fdedf807651f2836783a6c0068 Mon Sep 17 00:00:00 2001 From: LambdaYH Date: Mon, 7 Apr 2025 14:08:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgithubassets=E5=8C=B9?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ghproxy/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghproxy/main.go b/ghproxy/main.go index 61ad003..824cc55 100644 --- a/ghproxy/main.go +++ b/ghproxy/main.go @@ -32,7 +32,7 @@ var ( regexp.MustCompile(`^(?:https?://)?huggingface\.co(?:/spaces)?/([^/]+)/(.+)$`), regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co(?:/spaces)?/([^/]+)/([^/]+)(?:/(.*))?$`), regexp.MustCompile(`^(?:https?://)?download\.docker\.com/([^/]+)/.*\.(tgz|zip)$`), - regexp.MustCompile(`^(?:https?://)?([a-zA-Z0-9-]+\.)*githubassets\.com/([^/]+)/([^/]+)/.+?/.+$`), + regexp.MustCompile(`^(?:https?://)?([a-zA-Z0-9-]+\.)*githubassets\.com/([^/]+)/.+?$`), } httpClient *http.Client config *Config -- 2.49.1 From fc88d3d06e55654f49efe101b33c13213e90e42d Mon Sep 17 00:00:00 2001 From: LambdaYH Date: Mon, 7 Apr 2025 14:12:31 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96githubassets=E5=8C=B9?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ghproxy/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghproxy/main.go b/ghproxy/main.go index 824cc55..7e78d20 100644 --- a/ghproxy/main.go +++ b/ghproxy/main.go @@ -32,7 +32,7 @@ var ( regexp.MustCompile(`^(?:https?://)?huggingface\.co(?:/spaces)?/([^/]+)/(.+)$`), regexp.MustCompile(`^(?:https?://)?cdn-lfs\.hf\.co(?:/spaces)?/([^/]+)/([^/]+)(?:/(.*))?$`), regexp.MustCompile(`^(?:https?://)?download\.docker\.com/([^/]+)/.*\.(tgz|zip)$`), - regexp.MustCompile(`^(?:https?://)?([a-zA-Z0-9-]+\.)*githubassets\.com/([^/]+)/.+?$`), + regexp.MustCompile(`^(?:https?://)?(github|opengraph)\.githubassets\.com/([^/]+)/.+?$`), } httpClient *http.Client config *Config -- 2.49.1