|
9 | 9 | steps:
|
10 | 10 | - name: Checkout
|
11 | 11 | uses: actions/checkout@v4
|
| 12 | + with: |
| 13 | + persist-credentials: false |
12 | 14 | - name: Pull nightly image
|
13 | 15 | run: docker pull ghcr.io/zaproxy/zaproxy:nightly
|
14 | 16 | - name: Authentication plan tests
|
|
27 | 29 | uses: actions/upload-artifact@v4
|
28 | 30 | with:
|
29 | 31 | 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