adding YrPrey in other programming languages (#217) #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create WWW Update PR | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '**.json' | |
workflow_dispatch: | |
jobs: | |
create_pr: | |
name: Create Pull Request | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build Feature Branch and Raise PR | |
run: | | |
# Setup git details | |
export GITHUB_USER=vwadbot | |
git config --global user.email "[email protected]" | |
git config --global user.name $GITHUB_USER | |
# Clone repos | |
git clone -o upstream https://github.com/OWASP/www-project-vulnerable-web-applications-directory.git | |
git clone https://github.com/OWASP/OWASP-VWAD.git | |
cd www-project-vulnerable-web-applications-directory | |
WWW_BASE="$(pwd)" | |
git remote add origin https://github.com/$GITHUB_USER/www-project-vulnerable-web-applications-directory.git | |
cd ../OWASP-VWAD | |
VWAD_BASE="$(pwd)" | |
# Setup env vars for later | |
SRC_BASE="OWASP/OWASP-VWAD@"$(git log -1 --format=format:%h) | |
BRANCH="vwad-update" | |
SHORT_DATE="$(date +"%Y-%m-%d")" | |
export GITHUB_TOKEN=${{ secrets.vwad_deploy_token }} | |
# Build the feature branch | |
cd $WWW_BASE | |
git checkout -b $BRANCH | |
rm _data/collection.json | |
cp $VWAD_BASE/src/data/collection.json $WWW_BASE/_data/. | |
git remote set-url origin https://$GITHUB_USER:${{ secrets.vwad_deploy_token }}@github.com/$GITHUB_USER/www-project-vulnerable-web-applications-directory.git | |
git add . | |
git commit -m "VWAD Update $SHORT_DATE" -m "Updates based on $SRC_BASE" | |
git push --set-upstream origin $BRANCH --force | |
# Open the PR | |
gh pr create -R OWASP/www-project-vulnerable-web-applications-directory --fill |