Skip to content

Commit 3f3f371

Browse files
authored
Merge pull request #835 from Azure/refine-ci-and-hooks
chore: refine ci and hooks
2 parents 771b3a6 + b420d40 commit 3f3f371

4 files changed

Lines changed: 4 additions & 13 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env sh
2-
":" //; if command -v pwsh >/dev/null 2>&1; then pwsh -ExecutionPolicy Bypass -File .githooks/pre-push.ps1; else sh .githooks/pre-push.sh; fi; exit $? # Try PowerShell Core first, then sh on Unix
2+
":" //; if command -v pwsh >/dev/null 2>&1; then pwsh -ExecutionPolicy Bypass -File .githooks/pre-commit.ps1; else sh .githooks/pre-commit.sh; fi; exit $? # Try PowerShell Core first, then sh on Unix
33
":" //; exit # Skip rest on Unix
44

55
@echo off
66
powershell -NoProfile -Command "if (Get-Command powershell -ErrorAction SilentlyContinue) { exit 0 } else { exit 1 }"
77
if %errorlevel% equ 0 (
8-
powershell -ExecutionPolicy Bypass -File .githooks\pre-push.ps1
8+
powershell -ExecutionPolicy Bypass -File .githooks\pre-commit.ps1
99
) else (
1010
echo Error: PowerShell is not available. Please install PowerShell.
1111
exit /b 1
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $Modules = $ChangedFiles |
1010
ForEach-Object { ($_ -split "/")[0] } | # Extract the moudule
1111
Sort-Object -Unique # Ensure uniqueness
1212

13-
Write-Host "Verifying command models..." -ForegroundColor Green
13+
Write-Host "Verifying command models...`n" -ForegroundColor Green
1414

1515
# Get Git root directory
1616
$GitRoot = git rev-parse --show-toplevel
@@ -20,7 +20,6 @@ $Modules | ForEach-Object {
2020
Write-Host "Running: aaz-dev command-model verify -a $GitRoot -t $_" -ForegroundColor Yellow # For logging
2121
aaz-dev command-model verify -a $GitRoot -t $_
2222
if ($LASTEXITCODE -ne 0) {
23-
Write-Host "Please pull the latest <Main> branch, and <Export> your command model again." -ForegroundColor Red
2423
exit 1
2524
}
2625
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Modules=$(echo "$ChangedFiles" |
1616
cut -d '/' -f 1 | # Extract the module
1717
sort -u) # Ensure uniqueness
1818

19-
echo "${GREEN}Verifying command models...${NC}"
19+
echo -e "${GREEN}Verifying command models...${NC}\n"
2020

2121
# Get Git root directory
2222
GitRoot=$(git rev-parse --show-toplevel)
@@ -26,7 +26,6 @@ for Module in $Modules; do
2626
echo "${YELLOW}Running: aaz-dev command-model verify -a $GitRoot -t $Module${NC}" # For logging
2727
aaz-dev command-model verify -a "$GitRoot" -t "$Module"
2828
if [[ $? -ne 0 ]]; then
29-
echo "${RED}Please pull the latest <Main> branch, and <Export> your command model again.${NC}"
3029
exit 1
3130
fi
3231
done

‎.github/workflows/verify-metadata.yml‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,3 @@ jobs:
2828
- name: Verify data consistency
2929
id: verification
3030
run: aaz-dev command-model verify --aaz-path $GITHUB_WORKSPACE
31-
continue-on-error: true
32-
33-
- name: Check on exception
34-
if: steps.verification.outcome != 'success'
35-
run: |
36-
echo "Please pull the latest <main> branch, and <Export> your command model again."
37-
exit 1

0 commit comments

Comments
 (0)