Skip to content

Commit b7e37f4

Browse files
committed
fix: prevent Release Please PRs from blocking due to skipped required checks
Move skip conditions from job level to step level to ensure jobs always report a status. This fixes the "Expected — Waiting for status to be reported" issue that blocks Release Please PRs from merging. Problem: - When jobs are skipped with job-level if conditions, they don't report any status - GitHub's required checks wait forever for a status that never comes - This blocks Release Please PRs even though the checks aren't needed Solution: - Jobs always run and report success - For Release Please PRs, run a simple echo step and skip actual work - For normal PRs, run all validation steps as usual Affected jobs: - PowerShell Script Analysis - Shell Script Analysis - Markdown Lint - JSON/YAML Validation - Security Scan (Trivy) This ensures all required checks complete with a success status for Release Please PRs.
1 parent f131fe2 commit b7e37f4

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

.github/workflows/lint.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ permissions:
1111
jobs:
1212
powershell:
1313
name: PowerShell Script Analysis
14-
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
1514
runs-on: windows-latest
1615

1716
steps:
17+
- name: Skip for Release Please
18+
if: ${{ startsWith(github.head_ref, 'release-please--branches--') }}
19+
run: echo "Skipping PowerShell analysis for Release Please PR"
20+
1821
- uses: actions/checkout@v5
22+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
1923

2024
- name: Run PSScriptAnalyzer
25+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
2126
uses: microsoft/psscriptanalyzer-action@v1.1
2227
with:
2328
path: ./scripts/windows
@@ -27,19 +32,24 @@ jobs:
2732

2833
- name: Upload PSScriptAnalyzer results
2934
uses: github/codeql-action/upload-sarif@v3
30-
if: always()
35+
if: ${{ always() && ! startsWith(github.head_ref, 'release-please--branches--') }}
3136
with:
3237
sarif_file: results.sarif
3338

3439
shellcheck:
3540
name: Shell Script Analysis
36-
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
3741
runs-on: ubuntu-latest
3842

3943
steps:
44+
- name: Skip for Release Please
45+
if: ${{ startsWith(github.head_ref, 'release-please--branches--') }}
46+
run: echo "Skipping Shell Script analysis for Release Please PR"
47+
4048
- uses: actions/checkout@v5
49+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
4150

4251
- name: Run ShellCheck
52+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
4353
uses: ludeeus/action-shellcheck@master
4454
with:
4555
scandir: './scripts'
@@ -48,13 +58,18 @@ jobs:
4858

4959
markdown:
5060
name: Markdown Lint
51-
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
5261
runs-on: ubuntu-latest
5362

5463
steps:
64+
- name: Skip for Release Please
65+
if: ${{ startsWith(github.head_ref, 'release-please--branches--') }}
66+
run: echo "Skipping Markdown lint for Release Please PR"
67+
5568
- uses: actions/checkout@v5
69+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
5670

5771
- name: Run markdownlint
72+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
5873
uses: DavidAnson/markdownlint-cli2-action@v20
5974
with:
6075
globs: |
@@ -64,13 +79,18 @@ jobs:
6479
6580
json-yaml:
6681
name: JSON/YAML Validation
67-
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
6882
runs-on: ubuntu-latest
6983

7084
steps:
85+
- name: Skip for Release Please
86+
if: ${{ startsWith(github.head_ref, 'release-please--branches--') }}
87+
run: echo "Skipping JSON/YAML validation for Release Please PR"
88+
7189
- uses: actions/checkout@v5
90+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
7291

7392
- name: Validate JSON files
93+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
7494
run: |
7595
find . -name "*.json" -type f -not -path "./node_modules/*" | while read file; do
7696
echo "Validating $file"
@@ -79,11 +99,13 @@ jobs:
7999
echo "All JSON files are valid"
80100
81101
- name: Setup Python
102+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
82103
uses: actions/setup-python@v5
83104
with:
84105
python-version: '3.x'
85106

86107
- name: Validate YAML files
108+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
87109
run: |
88110
pip install pyyaml
89111
find . -name "*.yml" -o -name "*.yaml" -type f -not -path "./node_modules/*" | while read file; do
@@ -94,13 +116,18 @@ jobs:
94116
95117
security:
96118
name: Security Scan
97-
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
98119
runs-on: ubuntu-latest
99120

100121
steps:
122+
- name: Skip for Release Please
123+
if: ${{ startsWith(github.head_ref, 'release-please--branches--') }}
124+
run: echo "Skipping Trivy security scan for Release Please PR"
125+
101126
- uses: actions/checkout@v5
127+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
102128

103129
- name: Run Trivy security scanner
130+
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
104131
uses: aquasecurity/trivy-action@master
105132
with:
106133
scan-type: 'fs'
@@ -110,6 +137,6 @@ jobs:
110137

111138
- name: Upload Trivy results to GitHub Security
112139
uses: github/codeql-action/upload-sarif@v3
113-
if: always()
140+
if: ${{ always() && ! startsWith(github.head_ref, 'release-please--branches--') }}
114141
with:
115142
sarif_file: 'trivy-results.sarif'

0 commit comments

Comments
 (0)