1+ name : Update Sample Data
2+
3+ env :
4+ GIT_USERNAME : " DefectDojo release bot"
5+ GIT_EMAIL : " dojo-release-bot@users.noreply.github.com"
6+
7+ on :
8+ workflow_dispatch : # Trigger manually
9+ schedule :
10+ # Run on the 1st day of January, April, July, and October at midnight UTC
11+ - cron : ' 0 0 1 1,4,7,10 *'
12+
13+ jobs :
14+ run-binary-and-create-pr :
15+ runs-on : ubuntu-latest
16+ steps :
17+ # Checkout the repository
18+ - name : Checkout code
19+ uses : actions/checkout@v3
20+ with :
21+ ref : ${{ github.ref_name || 'dev'}}
22+
23+ - name : Run binary
24+ run : |
25+ ./fixture-updater dojo/fixtures/defect_dojo_sample_data.json
26+ mv output.json dojo/fixtures/defect_dojo_sample_data.json
27+
28+ - name : Configure git
29+ run : |
30+ git config --global user.name "${{ env.GIT_USERNAME }}"
31+ git config --global user.email "${{ env.GIT_EMAIL }}"
32+
33+ - name : Create and switch to a new branch
34+ run : |
35+ git checkout -b update-file-$(date +%Y%m%d%H%M%S)
36+ git add dojo/fixtures/defect_dojo_sample_data.json
37+ git commit -m "Update sample data"
38+
39+ - name : Push branch
40+ env :
41+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42+ run : |
43+ git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
44+
45+ - name : Create Pull Request
46+ uses : peter-evans/create-pull-request@v5
47+ with :
48+ token : ${{ secrets.GITHUB_TOKEN }}
49+ commit-message : " Update sample data"
50+ branch : ${{ github.ref_name || 'dev'}}
51+ base : dev
52+ title : " Update sample data"
53+ body : " This pull request updates the sample data."
0 commit comments