Skip to content

Commit 62e6ab6

Browse files
committed
gha/ci: allow validate/all-done to succeed for non-PRs
When we run CI not on a pull request, the commit job is skipped, as a result, all-done is also skipped. To allow all-done to succeed, modify the commit job to succeed for non-PRs. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent b39bd10 commit 62e6ab6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/validate.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,26 @@ jobs:
157157
contents: read
158158
pull-requests: read
159159
runs-on: ubuntu-24.04
160-
# Only check commits on pull requests.
161-
if: github.event_name == 'pull_request'
162160
steps:
163161
- name: get pr commits
162+
if: github.event_name == 'pull_request' # Only check commits on pull requests.
164163
id: 'get-pr-commits'
165164
uses: tim-actions/[email protected]
166165
with:
167166
token: ${{ secrets.GITHUB_TOKEN }}
168167

169168
- name: check subject line length
169+
if: github.event_name == 'pull_request' # Only check commits on pull requests.
170170
uses: tim-actions/[email protected]
171171
with:
172172
commits: ${{ steps.get-pr-commits.outputs.commits }}
173173
pattern: '^.{0,72}(\n.*)*$'
174174
error: 'Subject too long (max 72)'
175175

176+
- name: succeed (not a PR) # Allow all-done to succeed for non-PRs.
177+
if: github.event_name != 'pull_request'
178+
run: echo "Nothing to check here."
179+
176180
cfmt:
177181
runs-on: ubuntu-24.04
178182
steps:

0 commit comments

Comments
 (0)