From f3622b3d44a9f3f7cea465abaf5e8ceb2d632ec5 Mon Sep 17 00:00:00 2001 From: snowykami Date: Sun, 13 Apr 2025 22:50:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=93=E5=BA=93=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=86=99=E4=B8=8D=E6=95=8F=E6=84=9F=E7=9A=84=E6=AF=94?= =?UTF-8?q?=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release-nightly.yml | 132 +++++++++++++-------------- internal/app/run/runner.go | 4 +- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/.gitea/workflows/release-nightly.yml b/.gitea/workflows/release-nightly.yml index ea68adc..63b4050 100644 --- a/.gitea/workflows/release-nightly.yml +++ b/.gitea/workflows/release-nightly.yml @@ -1,76 +1,76 @@ name: release-nightly on: - push: - branches: [main] - tags: - - "*" + push: + branches: [main] + tags: + - "*" jobs: - release-image: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - env: - DOCKER_ORG: gitea - DOCKER_LATEST: nightly - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # all history for all branches and tags + release-image: + runs-on: liteyukios-latest + container: + image: catthehacker/ubuntu:act-latest + env: + DOCKER_ORG: gitea + DOCKER_LATEST: nightly + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # all history for all branches and tags - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 - - name: Login to Liteyuki Harbor - uses: docker/login-action@v3 - with: - registry: reg.liteyuki.icu - username: ${{ secrets.HARBOR_USERNAME }} - password: ${{ secrets.HARBOR_PASSWORD }} + - name: Login to Liteyuki Harbor + uses: docker/login-action@v3 + with: + registry: reg.liteyuki.icu + username: ${{ secrets.HARBOR_USERNAME }} + password: ${{ secrets.HARBOR_PASSWORD }} - - name: Get Meta - id: meta - run: | - echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT - echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT + - name: Get Meta + id: meta + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT + echo REPO_VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_OUTPUT - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - target: basic - platforms: | - linux/amd64 -# linux/arm64 - push: true - tags: | - reg.liteyuki.icu/comp/liteyuki-runner:latest + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + target: basic + platforms: | + linux/amd64 + linux/arm64 + push: true + tags: | + reg.liteyuki.icu/comp/liteyuki-runner:latest -# - name: Build and push dind -# uses: docker/build-push-action@v5 -# with: -# context: . -# file: ./Dockerfile -# target: dind -# platforms: | -# linux/amd64 -## linux/arm64 -# push: true -# tags: | -# reg.liteyuki.icu/comp/liteyuki-runner:latest-dind -# -# - name: Build and push dind-rootless -# uses: docker/build-push-action@v5 -# with: -# context: . -# file: ./Dockerfile -# target: dind-rootless -# platforms: | -# linux/amd64 -## linux/arm64 -# push: true -# tags: | -# reg.liteyuki.icu/comp/liteyuki-runner:latest-dind-rootless + - name: Build and push dind + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + target: dind + platforms: | + linux/amd64 + linux/arm64 + push: true + tags: | + reg.liteyuki.icu/comp/liteyuki-runner:latest-dind + + - name: Build and push dind-rootless + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + target: dind-rootless + platforms: | + linux/amd64 + linux/arm64 + push: true + tags: | + reg.liteyuki.icu/comp/liteyuki-runner:latest-dind-rootless diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 1bbbd56..fa789bb 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -267,8 +267,8 @@ func matchAllowedRepo(targetRepo string, allowedRepos []string) bool { continue } allowedOwner, allowedRepoName := parts[0], parts[1] - if (allowedOwner == "*" || allowedOwner == targetOwner) && - (allowedRepoName == "*" || allowedRepoName == targetRepoName) { + if (allowedOwner == "*" || strings.ToLower(allowedOwner) == strings.ToLower(targetOwner)) && + (allowedRepoName == "*" || strings.ToLower(allowedRepoName) == strings.ToLower(targetRepoName)) { return true } }