修复仓库匹配逻辑,添加大小写不敏感的比较
Some checks failed
checks / check and test (push) Successful in 10m38s
release-nightly / release-image (push) Failing after 20m24s

This commit is contained in:
远野千束 2025-04-13 22:50:38 +08:00
parent eceef92735
commit f3622b3d44
2 changed files with 68 additions and 68 deletions

View File

@ -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

View File

@ -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
}
}