Skip to content

Commit 786ac93

Browse files
committed
add dockerhub-push.yml 2022-09-01
1 parent 782e6f1 commit 786ac93

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

.github/workflows/dockerhub-push.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 🌥 Docker Push
2+
3+
on:
4+
workflow_run:
5+
workflows: ["🎉 Release Binary"]
6+
types:
7+
- completed
8+
workflow_dispatch:
9+
10+
jobs:
11+
docker:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Git Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Get Github tag
18+
id: meta
19+
run: |
20+
echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/hktalent/scan4all/releases/latest" | jq -r .tag_name)"
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v2
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2
27+
28+
- name: Login to DockerHub
29+
uses: docker/login-action@v2
30+
with:
31+
username: ${{ secrets.DOCKER_USERNAME }}
32+
password: ${{ secrets.DOCKER_TOKEN }}
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v3
36+
with:
37+
context: .
38+
platforms: linux/amd64
39+
push: true
40+
tags: hktalent/scan4all:latest,hktalent/scan4all:${{ steps.meta.outputs.tag }}

pkg/fingerprint/fingerScan.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ func SvUrl2Id(szUrl string, finp *Fingerprint, rMz string) {
9090

9191
func CaseMethod(szUrl, method, bodyString, favhash, md5Body, hexBody string, finp *Fingerprint) []string {
9292
cms := []string{}
93-
if !strings.HasSuffix(szUrl, finp.UrlPath) || 0 == len(finp.Keyword) {
93+
u01, _ := url.Parse(strings.TrimSpace(szUrl))
94+
if u01.Path != finp.UrlPath || 0 == len(finp.Keyword) {
9495
//log.Printf("%+v", finp)
9596
return cms
9697
}
97-
u01, _ := url.Parse(strings.TrimSpace(szUrl))
98+
9899
if _, ok := Mfavhash.Load(u01.Host + favhash); ok {
99100
return cms
100101
}

pkg/fingerprint/matchfinger.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ func iskeyword(str string, keyword []string, KeywordMathOr bool) (x bool, rstr s
1414
x = x && true
1515
rstr = k
1616
if KeywordMathOr {
17+
x = true
1718
break
1819
}
1920
} else {
@@ -37,6 +38,7 @@ func isregular(str string, keyword []string, KeywordMathOr bool) (x bool, rstr s
3738
x = x && true
3839
rstr = k
3940
if KeywordMathOr {
41+
x = true
4042
break
4143
}
4244
} else {

0 commit comments

Comments
 (0)