File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 - main
66permissions :
77 contents : write
8+ pull-requests : write
89jobs :
910 build-sql-file :
1011 runs-on : ubuntu-latest
1314 with :
1415 fetch-depth : 0
1516 token : ${{ secrets.PAT_TOKEN }}
16- - name : Checkout Code
17- run : |
18- git config --global user.name 'Darling Data'
19- git config --global user.email 'erik@erikdarling.com'
20- git checkout
2117 - name : Trim trailing whitespace and replace Tabs
2218 shell : pwsh
2319 run : |
@@ -35,23 +31,27 @@ jobs:
3531 if ($CharArray[$charIdx] -eq "`t") {
3632 $currentTab = $tabSize - (($charIdx + $slidingOffset) % $tabSize)
3733 $slidingOffset += $currentTab - 1
38- $lineOutput += (" " * $currentTab)
34+ $lineOutput += (" " * $currentTab)
3935 }
4036 else {
41- $lineOutput += $CharArray[$charIdx]
37+ $lineOutput += $CharArray[$charIdx]
4238 }
4339 }
4440 $outputString += $lineOutput.TrimEnd() + "`n" # Add line output with trailing spaces removed to the output string, and add newline
4541 }
4642 Set-Content -Path $fullPath -Value ($outputString.TrimEnd())
47- }
43+ }
4844 - name : Compile SQL File
4945 shell : pwsh
50- run : |
46+ run : |
5147 cd Install-All
5248 ./Merge-All.ps1
53- - name : Commit Updated File
54- run : |
55- git add .
56- git commit -am "Automation: Format and Build SQL File"
57- git push
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
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.base_ref }} == "main" ]; then
16- echo "Merge requests to main branch are only allowed from dev branch ."
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 ."
1717 exit 1
1818 fi
You can’t perform that action at this time.
0 commit comments