From a0a31f00e9b58763f7b4a3b40468aa3f777ca373 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Thu, 29 May 2025 14:46:49 -0400 Subject: [PATCH] ci(docs lint): fix workflow for external lints (#35968) Workflow for external lints still not working quite right. 1. The lint workflow should fail if linting fails, to block merge. Right now the exit status of the linter is ignored; added a step to fix that. 2. The workflow_run event is not triggered by completion of the first workflow. Couldn't find an obvious problem with the two, but saw online that some people had problems with a quoted workflow name, so tried renaming the workflows to avoid having to quote the names. --- .github/workflows/docs-lint-v2-comment.yml | 4 ++-- .github/workflows/docs-lint-v2.yml | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs-lint-v2-comment.yml b/.github/workflows/docs-lint-v2-comment.yml index 89c037c42fa..a518588e551 100644 --- a/.github/workflows/docs-lint-v2-comment.yml +++ b/.github/workflows/docs-lint-v2-comment.yml @@ -1,4 +1,4 @@ -name: Comment on external PRs with linter results +name: docs_lint_comment_external # This is a continuation of ./docs-lint-v2.yml, to write comments on external # PRs. @@ -11,7 +11,7 @@ name: Comment on external PRs with linter results on: workflow_run: - workflows: ['[Docs] Lint v2'] + workflows: [docs_lint] types: - completed diff --git a/.github/workflows/docs-lint-v2.yml b/.github/workflows/docs-lint-v2.yml index cf543f15f1e..4ceb1f82102 100644 --- a/.github/workflows/docs-lint-v2.yml +++ b/.github/workflows/docs-lint-v2.yml @@ -1,4 +1,4 @@ -name: '[Docs] Lint v2' +name: docs_lint # Runs the docs linter on PRs that edit docs content. # There are two branches of this workflow for internal and external PRs, due @@ -102,3 +102,6 @@ jobs: with: name: lint_results path: __github_actions__pr/ + - name: fail if linter fails (external) + if: steps.filter.outputs.docs == 'true' && github.event.pull_request.head.repo.full_name != github.repository && steps.external_lint.outputs.LINT_EXIT_CODE != 0 + run: exit 1