mirror of
https://github.com/DaoCloud/public-image-mirror.git
synced 2025-08-29 00:35:30 +08:00
Update image match
This commit is contained in:
6
.github/workflows/verify-pr.yml
vendored
6
.github/workflows/verify-pr.yml
vendored
@@ -54,9 +54,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Verify allows.txt sort
|
- name: Verify allows.txt sort
|
||||||
run: |
|
run: |
|
||||||
./hack/verify-fmt.sh allows.txt || {
|
./hack/verify-image-match.sh allows.txt || {
|
||||||
echo "Please run './hack/fmt.sh allows.txt'"
|
echo "Please run './hack/fmt-image-match.sh allows.txt'"
|
||||||
gh pr comment "${{ github.event.pull_request.number }}" --body '请运行 `./hack/fmt.sh allows.txt` 对内容进行排序'
|
gh pr comment "${{ github.event.pull_request.number }}" --body '请运行 `./hack/fmt-image-match.sh allows.txt` 对内容进行排序'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -287,7 +287,6 @@ docker.io/prom/**
|
|||||||
docker.io/prometheuscommunity/**
|
docker.io/prometheuscommunity/**
|
||||||
docker.io/pytorch/**
|
docker.io/pytorch/**
|
||||||
docker.io/qdrant/**
|
docker.io/qdrant/**
|
||||||
docker.io/qdrant/qdrant
|
|
||||||
docker.io/rancher/**
|
docker.io/rancher/**
|
||||||
docker.io/rclone/**
|
docker.io/rclone/**
|
||||||
docker.io/redislabs/**
|
docker.io/redislabs/**
|
||||||
@@ -306,8 +305,6 @@ docker.io/sonobuoy/**
|
|||||||
docker.io/soulter/astrbot
|
docker.io/soulter/astrbot
|
||||||
docker.io/squidfunk/**
|
docker.io/squidfunk/**
|
||||||
docker.io/starrocks/**
|
docker.io/starrocks/**
|
||||||
docker.io/starrocks/dev-env-centos7
|
|
||||||
docker.io/starrocks/dev-env-ubuntu
|
|
||||||
docker.io/tailscale/**
|
docker.io/tailscale/**
|
||||||
docker.io/talebook/talebook
|
docker.io/talebook/talebook
|
||||||
docker.io/tdengine/**
|
docker.io/tdengine/**
|
||||||
|
44
hack/fmt-image-match.sh
Executable file
44
hack/fmt-image-match.sh
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
function check_match() {
|
||||||
|
local image=$1
|
||||||
|
local lines=$2
|
||||||
|
for line in ${lines}; do
|
||||||
|
if [[ "${line}" == *"**" ]]; then
|
||||||
|
if [[ "${image}" == "${line%\*\*}"* ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
elif [[ "${line}" == *"*" ]]; then
|
||||||
|
if [[ "${image}" == "${line%\*}"* ]]; then
|
||||||
|
if [[ "${image#"${line%\*}"}" != *"/"* ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "${image}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function format() {
|
||||||
|
local file=$1
|
||||||
|
local lines="$(cat "${file}")"
|
||||||
|
for line in ${lines}; do
|
||||||
|
if [[ "${line}" != *"*" ]]; then
|
||||||
|
check_match "${line}" "${lines}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for line in ${lines}; do
|
||||||
|
if [[ "${line}" == *"*" ]]; then
|
||||||
|
echo ${line}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
export LC_ALL=C
|
||||||
|
file=$1
|
||||||
|
|
||||||
|
format "${file}" |
|
||||||
|
sort -u |
|
||||||
|
grep -v '^$' >$1.tmp && mv $1.tmp $1
|
9
hack/verify-image-match.sh
Executable file
9
hack/verify-image-match.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export LC_ALL=C
|
||||||
|
|
||||||
|
cp $1 $1.bak
|
||||||
|
|
||||||
|
$(dirname "${BASH_SOURCE}")/fmt-image-match.sh $1.bak
|
||||||
|
|
||||||
|
diff -c $1 $1.bak && rm $1.bak
|
Reference in New Issue
Block a user