Skip to content

Commit 1c27e78

Browse files
committed
auth test: PR results
Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
1 parent b99487f commit 1c27e78

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/auth-tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
1214
- name: Pull nightly image
1315
run: docker pull ghcr.io/zaproxy/zaproxy:nightly
1416
- name: Authentication plan tests
@@ -27,3 +29,31 @@ jobs:
2729
uses: actions/upload-artifact@v4
2830
with:
2931
path: output/output.yml
32+
- name: Build Feature Branch and Raise PR
33+
run: |
34+
# Setup git details
35+
export GITHUB_USER=zapbot
36+
git config --global user.email "12745184+zapbot@users.noreply.github.com"
37+
git config --global user.name $GITHUB_USER
38+
# Clone destination repo
39+
git clone -o upstream https://github.com/zaproxy/zaproxy-website.git
40+
cd zaproxy-website
41+
git remote add origin https://github.com/$GITHUB_USER/zaproxy-website.git
42+
# Setup env vars for later
43+
BRANCH="auth-tests-update"
44+
SHORT_DATE="$(date +"%Y-%m-%d")"
45+
export GITHUB_TOKEN=${{ secrets.ZAPBOT_TOKEN }}
46+
# Build the feature branch
47+
git checkout -b $BRANCH
48+
cp -f ../output/output.yml site/data/scans/auth/output.yml
49+
## Update the index to be sure git is aware of changes
50+
git update-index -q --refresh
51+
## If there are changes: comment, commit, PR
52+
if ! git diff-index --quiet HEAD --; then
53+
git remote set-url origin https://$GITHUB_USER:$GITHUB_TOKEN@github.com/$GITHUB_USER/zaproxy-website.git
54+
git add .
55+
git commit -m "Authentication Tests Update $SHORT_DATE" --signoff
56+
git push --set-upstream origin $BRANCH --force
57+
# Open the PR
58+
gh pr create -f
59+
fi

0 commit comments

Comments
 (0)