Skip to content

Commit 393b26b

Browse files
committed
versus workflows: Update existing PR if any instead of closing/opening
Signed-off-by: kingthorin <[email protected]>
1 parent ff010f5 commit 393b26b

File tree

7 files changed

+43
-97
lines changed

7 files changed

+43
-97
lines changed

.github/workflows/auth-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ jobs:
5858
git add .
5959
git commit -sm 'Authentication Tests Update'
6060
git push -u origin $BRANCH -f
61-
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create -f
61+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6262
fi

.github/workflows/zap-vs-crawlmaze.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ jobs:
1818
1919
git clone https://github.com/$GITHUB_USER/zaproxy-website.git
2020
21-
# Update to the latest upstream
22-
cd zaproxy-website
23-
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
24-
git remote add upstream https://github.com/zaproxy/zaproxy-website.git
25-
git checkout -B crawlmaze
26-
git pull upstream main
27-
git reset --hard upstream/main
28-
git push --set-upstream origin crawlmaze --force
29-
3021
- name: Scan Crawl Maze
3122
run: |
3223
cd zap-mgmt-scripts/scans/crawlmaze
@@ -56,16 +47,16 @@ jobs:
5647
run: |
5748
cd zaproxy-website
5849
50+
git checkout -b crawlmaze
51+
5952
# Update the index to be sure git is aware of changes
6053
git update-index -q --refresh
6154
## If there are changes: comment, commit, PR
6255
if ! git diff-index --quiet HEAD --; then
63-
56+
gh repo set-default zaproxy/zaproxy-website
57+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
6458
git add site/data/scans/crawlmaze/*
65-
git commit -s -m "Updated Crawl Maze Results"
66-
git push origin
67-
68-
echo ${{ secrets.ZAPBOT_TOKEN }} | gh auth login --with-token
69-
gh pr create --fill
70-
59+
git commit -sm "Updated Crawl Maze Results"
60+
git push -u origin $BRANCH -f
61+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
7162
fi

.github/workflows/zap-vs-firingrange.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ jobs:
2020
2121
git clone https://github.com/$GITHUB_USER/zaproxy-website.git
2222
23-
# Update to the latest upstream
24-
cd zaproxy-website
25-
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
26-
git remote add upstream https://github.com/zaproxy/zaproxy-website.git
27-
git checkout -B firingrange
28-
git pull upstream main
29-
git reset --hard upstream/main
30-
git push --set-upstream origin firingrange --force
31-
3223
- name: Scan Firing Range
3324
run: |
3425
cd zap-mgmt-scripts/scans/firingrange
@@ -46,16 +37,16 @@ jobs:
4637
run: |
4738
cd zaproxy-website
4839
40+
git checkout -b firingrange
41+
4942
# Update the index to be sure git is aware of changes
5043
git update-index -q --refresh
5144
## If there are changes: comment, commit, PR
5245
if ! git diff-index --quiet HEAD --; then
53-
46+
gh repo set-default zaproxy/zaproxy-website
47+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
5448
git add site/data/scans/firingrange/*
55-
git commit -s -m "Updated Firing Range Results"
56-
git push origin
57-
58-
echo ${{ secrets.ZAPBOT_TOKEN }} | gh auth login --with-token
59-
gh pr create --fill
60-
49+
git commit -sm "Updated Firing Range Results"
50+
git push -u origin $BRANCH -f
51+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6152
fi

.github/workflows/zap-vs-juiceshop.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ jobs:
2020
2121
git clone https://github.com/$GITHUB_USER/zaproxy-website.git
2222
23-
# Update to the latest upstream
24-
cd zaproxy-website
25-
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
26-
git remote add upstream https://github.com/zaproxy/zaproxy-website.git
27-
git checkout -B juiceshop
28-
git pull upstream main
29-
git reset --hard upstream/main
30-
git push --set-upstream origin juiceshop --force
31-
3223
- name: Scan Juice Shop
3324
run: |
3425
# start Juice Shop
@@ -45,16 +36,16 @@ jobs:
4536
run: |
4637
cd zaproxy-website
4738
39+
git checkout -b juiceshop
40+
4841
# Update the index to be sure git is aware of changes
4942
git update-index -q --refresh
5043
## If there are changes: comment, commit, PR
5144
if ! git diff-index --quiet HEAD --; then
52-
45+
gh repo set-default zaproxy/zaproxy-website
46+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
5347
git add site/data/scans/juiceshop/*
54-
git commit -s -m "Updated Juice Shop Results"
55-
git push origin
56-
57-
echo ${{ secrets.ZAPBOT_TOKEN }} | gh auth login --with-token
58-
gh pr create --fill
59-
48+
git commit -sm "Updated Juice Shop Results"
49+
git push -u origin $BRANCH -f
50+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6051
fi

.github/workflows/zap-vs-owasp-benchmark.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ jobs:
2929
git clone https://github.com/$GITHUB_USER/zap-mgmt-scripts.git
3030
git clone https://github.com/$GITHUB_USER/zaproxy-website.git
3131
32-
# Update to the latest upstream
33-
cd zaproxy-website
34-
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
35-
git remote add upstream https://github.com/zaproxy/zaproxy-website.git
36-
git checkout -B owasp-benchmark
37-
git pull upstream main
38-
git reset --hard upstream/main
39-
git push --set-upstream origin owasp-benchmark --force
40-
4132
- name: Scan OWASP Benchmark
4233
run: |
4334
cd zap-mgmt-scripts/scans/benchmark
@@ -54,16 +45,16 @@ jobs:
5445
run: |
5546
cd zaproxy-website
5647
48+
git checkout -b owasp-benchmark
49+
5750
# Update the index to be sure git is aware of changes
5851
git update-index -q --refresh
5952
## If there are changes: comment, commit, PR
6053
if ! git diff-index --quiet HEAD --; then
61-
54+
gh repo set-default zaproxy/zaproxy-website
55+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
6256
git add site/data/scans/benchmark/*
63-
git commit -s -m "Updated OWASP Benchmark Results"
64-
git push origin
65-
66-
echo ${{ secrets.ZAPBOT_TOKEN }} | gh auth login --with-token
67-
gh pr create --fill
68-
57+
git commit -sm "Updated OWASP Benchmark Results"
58+
git push -u origin $BRANCH -f
59+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6960
fi

.github/workflows/zap-vs-ssti.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ jobs:
2020
2121
git clone https://github.com/$GITHUB_USER/zaproxy-website.git
2222
23-
# Update to the latest upstream
24-
cd zaproxy-website
25-
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
26-
git remote add upstream https://github.com/zaproxy/zaproxy-website.git
27-
git checkout -B ssti
28-
git pull upstream main
29-
git reset --hard upstream/main
30-
git push --set-upstream origin ssti --force
31-
3223
- name: Start V2SSTI
3324
run: |
3425
docker run -d -p 127.0.0.1:5000-5100:5000-5100 -p 127.0.0.1:6000-6100:6000-6100 -w /home d10g0mrs/websites_vuln_to_ssti sh ./start_all_services.sh
@@ -55,16 +46,16 @@ jobs:
5546
run: |
5647
cd zaproxy-website
5748
49+
git checkout -b ssti
50+
5851
# Update the index to be sure git is aware of changes
5952
git update-index -q --refresh
6053
## If there are changes: comment, commit, PR
6154
if ! git diff-index --quiet HEAD --; then
62-
55+
gh repo set-default zaproxy/zaproxy-website
56+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
6357
git add site/data/scans/ssti/*
64-
git commit -s -m "Updated Vuln to SSTI Results"
65-
git push origin
66-
67-
echo ${{ secrets.ZAPBOT_TOKEN }} | gh auth login --with-token
68-
gh pr create --fill
69-
58+
git commit -sm "Updated Vuln to SSTI Results"
59+
git push -u origin $BRANCH -f
60+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
7061
fi

.github/workflows/zap-vs-webseclab.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ jobs:
2020
2121
git clone https://github.com/$GITHUB_USER/zaproxy-website.git
2222
23-
# Update to the latest upstream
24-
cd zaproxy-website
25-
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
26-
git remote add upstream https://github.com/zaproxy/zaproxy-website.git
27-
git checkout -B webseclab
28-
git pull upstream main
29-
git reset --hard upstream/main
30-
git push --set-upstream origin webseclab --force
31-
3223
- name: Start Webseclab
3324
run: |
3425
docker run --network="host" -p 9090:9090 -d psiinon/webseclab
@@ -46,16 +37,16 @@ jobs:
4637
run: |
4738
cd zaproxy-website
4839
40+
git checkout -b webseclab
41+
4942
# Update the index to be sure git is aware of changes
5043
git update-index -q --refresh
5144
## If there are changes: comment, commit, PR
5245
if ! git diff-index --quiet HEAD --; then
53-
46+
gh repo set-default zaproxy/zaproxy-website
47+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
5448
git add site/data/scans/webseclab/*
55-
git commit -s -m "Updated Webseclab Results"
56-
git push origin
57-
58-
echo ${{ secrets.ZAPBOT_TOKEN }} | gh auth login --with-token
59-
gh pr create --fill
60-
49+
git commit -sm "Updated Webseclab Results"
50+
git push -u origin $BRANCH -f
51+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6152
fi

0 commit comments

Comments
 (0)