Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/build-sqlfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- main
permissions:
contents: write
pull-requests: write
jobs:
build-sql-file:
runs-on: ubuntu-latest
Expand All @@ -13,11 +14,6 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- name: Checkout Code
run: |
git config --global user.name 'Darling Data'
git config --global user.email 'erik@erikdarling.com'
git checkout
- name: Trim trailing whitespace and replace Tabs
shell: pwsh
run: |
Expand All @@ -35,23 +31,27 @@ jobs:
if ($CharArray[$charIdx] -eq "`t") {
$currentTab = $tabSize - (($charIdx + $slidingOffset) % $tabSize)
$slidingOffset += $currentTab - 1
$lineOutput += (" " * $currentTab)
$lineOutput += (" " * $currentTab)
}
else {
$lineOutput += $CharArray[$charIdx]
$lineOutput += $CharArray[$charIdx]
}
}
$outputString += $lineOutput.TrimEnd() + "`n" # Add line output with trailing spaces removed to the output string, and add newline
}
Set-Content -Path $fullPath -Value ($outputString.TrimEnd())
}
}
- name: Compile SQL File
shell: pwsh
run: |
run: |
cd Install-All
./Merge-All.ps1
- name: Commit Updated File
run: |
git add .
git commit -am "Automation: Format and Build SQL File"
git push
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PAT_TOKEN }}
commit-message: "Automation: Format and Build SQL File"
branch: automation/format-and-build
title: "Automation: Format and Build SQL File"
body: "Auto-generated formatting and rebuild of Install-All/DarlingData.sql"
delete-branch: true
4 changes: 2 additions & 2 deletions .github/workflows/main-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Check branches
run: |
if [ ${{ github.head_ref }} != "dev" ] && [ ${{ github.base_ref }} == "main" ]; then
echo "Merge requests to main branch are only allowed from dev branch."
if [ ${{ github.head_ref }} != "dev" ] && [ ${{ github.head_ref }} != "automation/format-and-build" ] && [ ${{ github.base_ref }} == "main" ]; then
echo "Merge requests to main branch are only allowed from dev or automation branches."
exit 1
fi