patternfly / patternfly/patternfly-react

Deploy fails on fork repo

未关闭
#12,655 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@dlabaj 已经在做这个了。

开始于 2026年9月17日。

PF Team
主要语言
TypeScript
星标
862
派生
392
平均合并
4 天 8 小时
30 天内合并 PR
9

描述

Summary

The automatic documentation preview deploy (documentation-deploy.yml)
fails for PRs opened from forks. The Resolve PR number step can't
determine which PR the build artifacts belong to, so the job errors out
and no preview gets deployed or linked back on the PR.

Steps to reproduce

  1. Open a PR from a fork against main.

  2. Wait for the Documentation workflow to complete successfully

    (it uploads documentation and a11y-coverage artifacts on the
    pull_request event).

  3. Watch for Documentation deploy to fire via workflow_run.

Expected behavior

documentation-deploy.yml downloads the artifacts, deploys them to
Surge, and posts a preview link back on the PR automatically.

Actual behavior

The job fails at the Resolve PR number step. Reproduced twice on the
same fork PR (#12653), failing identically on both the "opened" and
"synchronize" triggers:

Both fail within ~1 minute, at the same step, with the same downstream
failure in Upload accessibility results (which still attempts to run
via if: !cancelled(), then fails because the coverage artifact was
never downloaded).

Root cause

Resolve PR number first checks github.event.workflow_run.pull_requests,
which GitHub leaves empty for any fork PR by design (it's only
populated when the PR's head branch is in the same repo as the base).
That sends every fork PR into the fallback path:

PR_JSON=$(gh api --paginate "repos/${REPOSITORY}/commits/${HEAD_SHA}/pulls")

That API call is coming back with something other than exactly one
match, which the script treats as unrecoverable and exits 1 rather than
guessing.

Suggested fix

Have documentation.yml save github.event.pull_request.number as its
own small artifact (same as it already does for documentation and
a11y-coverage) on the pull_request event, and have
documentation-deploy.yml download and read that artifact instead of
trying to resolve the PR number after the fact via the API. This removes
the lookup — and its failure mode — entirely, since the PR number would
travel with the run the same reliable way the other artifacts already do.

Workaround in the meantime

A frequent-flyers team member can comment /deploy-preview (exact
string, top-level comment on the Conversation tab) on the PR. This
routes through documentation.yml's issue_comment path, which deploys
directly and doesn't depend on the broken resolution step.


Jira Issue: PF-4647

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。