Skip to content

Run Auth Tests

Run Auth Tests #210

Workflow file for this run

name: Run Auth Tests
on:
workflow_dispatch:
schedule:
# daily at 03:10
- cron: '10 3 * * *'
jobs:
publish:
name: Authentication Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Pull nightly image
run: docker pull ghcr.io/zaproxy/zaproxy:nightly
- name: Authentication plan tests
id: "test-auth-plans"
if: ${{ ! cancelled() }}
env:
AUTH_SCANS_CREDS: ${{ secrets.AUTH_SCANS_CREDS }}
run: |
echo "$AUTH_SCANS_CREDS" | tee -a scans/auth/all_vars.env > /dev/null
chmod -R a+w $(pwd)
docker run --rm -v $(pwd):/zap/wrk/:rw --env-file scans/auth/all_vars.env -t zaproxy/zap-nightly /zap/wrk/scans/auth/auth_plan_tests.sh
echo "\`\`\`yaml" >> $GITHUB_STEP_SUMMARY
cat output/output.yml >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
- name: Attach result
uses: actions/upload-artifact@v4
with:
path: output/output.yml
- name: Build Feature Branch and Raise PR
if: ${{ ! cancelled() }}
run: |
# Setup git details
export GITHUB_USER=zapbot
git config --global user.email "12745184+zapbot@users.noreply.github.com"
git config --global user.name $GITHUB_USER
# Clone destination repo
git clone -o upstream https://github.com/zaproxy/zaproxy-website.git
cd zaproxy-website
git remote add origin https://github.com/$GITHUB_USER/zaproxy-website.git
# Setup env vars for later
BRANCH="auth-tests-update"
export GITHUB_TOKEN=${{ secrets.ZAPBOT_TOKEN }}
# Build the feature branch
git checkout -b $BRANCH
cp -f ../output/output.yml site/data/scans/auth/output.yml
## Update the index to be sure git is aware of changes
git update-index -q --refresh
## If there are changes: comment, commit, PR
if ! git diff-index --quiet HEAD --; then
gh repo set-default zaproxy/zaproxy-website
git remote set-url origin https://$GITHUB_USER:$GITHUB_TOKEN@github.com/$GITHUB_USER/zaproxy-website.git
git add .
git commit -sm 'Authentication Tests Update'
git push -u origin $BRANCH -f
gh pr view --json mergedAt|jq -e '.mergedAt' && gh pr create -f
fi