File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Format and Regenerate SQL Main File
2- on :
2+ on :
33 push :
44 branches :
55 - main
66permissions :
77 contents : write
8- pull-requests : write
98jobs :
109 build-sql-file :
1110 runs-on : ubuntu-latest
1211 steps :
12+ - name : Generate App Token
13+ id : app-token
14+ uses : actions/create-github-app-token@v2
15+ with :
16+ app-id : ${{ secrets.APP_ID }}
17+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
1318 - uses : actions/checkout@v4
1419 with :
1520 fetch-depth : 0
16- token : ${{ secrets.PAT_TOKEN }}
21+ token : ${{ steps.app-token.outputs.token }}
22+ - name : Configure Git
23+ run : |
24+ git config --global user.name 'Darling Data'
25+ git config --global user.email 'erik@erikdarling.com'
1726 - name : Trim trailing whitespace and replace Tabs
1827 shell : pwsh
1928 run : |
4655 run : |
4756 cd Install-All
4857 ./Merge-All.ps1
49- - name : Create Pull Request
50- uses : peter-evans/create-pull-request@v7
51- with :
52- token : ${{ secrets.PAT_TOKEN }}
53- commit-message : " Automation: Format and Build SQL File"
54- branch : automation/format-and-build
55- title : " Automation: Format and Build SQL File"
56- body : " Auto-generated formatting and rebuild of Install-All/DarlingData.sql"
57- delete-branch : true
58+ - name : Commit and Push
59+ run : |
60+ git add .
61+ git diff --staged --quiet && echo "No changes to commit" && exit 0
62+ git commit -m "Automation: Format and Build SQL File"
63+ git push
Original file line number Diff line number Diff line change 1212 steps :
1313 - name : Check branches
1414 run : |
15- if [ ${{ github.head_ref }} != "dev" ] && [ ${{ github.head_ref }} != "automation/format-and-build" ] && [ ${{ github. base_ref }} == "main" ]; then
16- echo "Merge requests to main branch are only allowed from dev or automation branches ."
15+ if [ ${{ github.head_ref }} != "dev" ] && [ ${{ github.base_ref }} == "main" ]; then
16+ echo "Merge requests to main branch are only allowed from dev branch ."
1717 exit 1
1818 fi
You can’t perform that action at this time.
0 commit comments