From c136ee4c193f5c6a36e75d6cc4b2f3898902f506 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Fri, 25 Apr 2025 12:02:27 -0400 Subject: [PATCH] ci (docs): fix docs lint action on forks (#35277) Before: The docs lint action doesn't run properly on forks because it tries to use the branch name to identify the PR for updating, but the branch name is adapted on forks, so it is not `branch-name`, but `forking-account:branch-name`. After: Use the PR number instead to identify the PR instead. --- .github/workflows/docs-lint-v2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs-lint-v2.yml b/.github/workflows/docs-lint-v2.yml index 6586eb38da..aa977fcd5c 100644 --- a/.github/workflows/docs-lint-v2.yml +++ b/.github/workflows/docs-lint-v2.yml @@ -63,7 +63,7 @@ jobs: env: BASE_REF: ${{ github.base_ref }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH_NAME: ${{ github.head_ref }} + PR_NUMBER: ${{ github.event.pull_request.number }} run: | set -o pipefail run_lints() { @@ -76,6 +76,6 @@ jobs: LINT_EXIT_CODE=$? set -e if [[ $LINT_EXIT_CODE -ne 0 ]]; then - gh pr comment "$BRANCH_NAME" --body "$LINT_RESULTS" + gh pr comment "$PR_NUMBER" --body "$LINT_RESULTS" exit 1 fi