Skip to content

Commit

Permalink
Improve all-workflows consistency check
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Aug 12, 2024
1 parent 2ffa401 commit 9ad73eb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/branches-and-prs.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,23 @@ workflow(
) {
job(
id = "check_all_workflow_yaml_consistency",
name = "Check all Workflow YAML consistency",
name = "Check all Workflow YAML Consistency",
runsOn = UbuntuLatest
) {
uses(
name = "Checkout Repository",
action = Checkout()
)
run(
name = "Regenerate all workflow YAMLs and check for modifications",
command = """find .github/workflows -mindepth 1 -maxdepth 1 -name "*.main.kts" | xargs -ri sh -c '{} && git diff --exit-code'"""
name = "Regenerate all Workflow YAMLs",
command = """find .github/workflows -mindepth 1 -maxdepth 1 -name '*.main.kts' -exec {} \;"""
)
run(
name = "Check for Modifications",
command = """
git add --intent-to-add .
git diff --exit-code
""".trimIndent()
)
}

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/branches-and-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/branches-and-prs.yml'''
check_all_workflow_yaml_consistency:
name: 'Check all Workflow YAML consistency'
name: 'Check all Workflow YAML Consistency'
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
Expand All @@ -37,8 +37,13 @@ jobs:
name: 'Checkout Repository'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Regenerate all workflow YAMLs and check for modifications'
run: 'find .github/workflows -mindepth 1 -maxdepth 1 -name "*.main.kts" | xargs -ri sh -c ''{} && git diff --exit-code'''
name: 'Regenerate all Workflow YAMLs'
run: 'find .github/workflows -mindepth 1 -maxdepth 1 -name ''*.main.kts'' -exec {} \;'
- id: 'step-2'
name: 'Check for Modifications'
run: |-
git add --intent-to-add .
git diff --exit-code
build-and-verify:
name: 'Build and Verify'
runs-on: '${{ matrix.os }}'
Expand Down

0 comments on commit 9ad73eb

Please sign in to comment.