Skip to content

Commit 9e5b266

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

File tree

7 files changed

+33
-52
lines changed

7 files changed

+33
-52
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: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ jobs:
6060
git update-index -q --refresh
6161
## If there are changes: comment, commit, PR
6262
if ! git diff-index --quiet HEAD --; then
63-
63+
gh repo set-default zaproxy/zaproxy-website
64+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
6465
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-
66+
git commit -sm "Updated Crawl Maze Results"
67+
git push -u origin $BRANCH -f
68+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
7169
fi

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ jobs:
5050
git update-index -q --refresh
5151
## If there are changes: comment, commit, PR
5252
if ! git diff-index --quiet HEAD --; then
53-
53+
gh repo set-default zaproxy/zaproxy-website
54+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
5455
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-
56+
git commit -sm "Updated Firing Range Results"
57+
git push -u origin $BRANCH -f
58+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6159
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: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ jobs:
5858
git update-index -q --refresh
5959
## If there are changes: comment, commit, PR
6060
if ! git diff-index --quiet HEAD --; then
61-
61+
gh repo set-default zaproxy/zaproxy-website
62+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
6263
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-
64+
git commit -sm "Updated OWASP Benchmark Results"
65+
git push -u origin $BRANCH -f
66+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6967
fi

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ jobs:
5959
git update-index -q --refresh
6060
## If there are changes: comment, commit, PR
6161
if ! git diff-index --quiet HEAD --; then
62-
62+
gh repo set-default zaproxy/zaproxy-website
63+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
6364
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-
65+
git commit -sm "Updated Vuln to SSTI Results"
66+
git push -u origin $BRANCH -f
67+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
7068
fi

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ jobs:
5050
git update-index -q --refresh
5151
## If there are changes: comment, commit, PR
5252
if ! git diff-index --quiet HEAD --; then
53-
53+
gh repo set-default zaproxy/zaproxy-website
54+
git remote set-url origin https://$GITHUB_USER:[email protected]/$GITHUB_USER/zaproxy-website.git
5455
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-
56+
git commit -sm "Updated Webseclab Results"
57+
git push -u origin $BRANCH -f
58+
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create --fill
6159
fi

0 commit comments

Comments
 (0)