ci(github-actions): fix workflow failures for external fork PRs (WPB-8645)#4771
Merged
Conversation
yamilmedina
approved these changes
Apr 30, 2026
saleniuk
approved these changes
Apr 30, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



https://wearezeta.atlassian.net/browse/WPB-8645
What's new in this PR?
Issues
Four GitHub Actions workflows fail or produce incorrect behaviour when a PR is opened from an external contributor's fork:
jira-lint-and-link: The fork-detection guard (github.repository_owner == 'wireapp') always evaluates totrue, even for fork PRs, because GitHub runs the workflow in the base repo context. As a result the workflow attempted to useJIRA_TOKENon fork PRs where the secret is unavailable, causing a failure instead of a clean skip.pr-author-assigner: Used thepull_requesttrigger, which does not grantpull-requests: writepermission for fork PRs. Auto-assignment silently failed.semantic-commit-lint: Used thepull_requesttrigger, sogh pr edit --add-label / --remove-labelfailed on fork PRs due to missing write permissions. Also contained an unnecessaryactions/checkoutstep.publish-test-results: Theworkflow_runtrigger referencedworkflows: [Run Unit Tests]but no workflow with that name exists — the actual top-level PR workflows are named"Develop"and"Main". This meant the job never triggered. Additionally, ifDD_API_KEYis absent, the Datadog upload steps failed and took down the entire publish job.Solutions
jira-lint-and-link.yml: Replaced the broken fork check (github.repository_owner == 'wireapp') with the correct expression (github.event.pull_request.head.repo.full_name == github.repository) on both jobs. Fork PRs now skip cleanly; GitHub branch protection treats a conditionally-skipped required check as passing.pr-author-assigner.yml: Switched trigger frompull_requesttopull_request_target. The action only calls the GitHub API to assign the PR author — no fork code is checked out or executed.semantic-commit-lint.yml: Switched trigger topull_request_targetand removed the unnecessaryactions/checkoutstep. The semantic PR linter reads the PR title directly from the event payload via the GitHub API.publish-test-results.yml: Fixed theworkflow_runtrigger to listen to["Develop", "Main"](the actual top-level PR workflow names). AddedDD_API_KEYas a job-level env var and gated all three Datadog steps (setup-node,install datadog-ci,upload results) withif: ${{ env.DD_API_KEY != '' }}so they skip gracefully when the secret is not configured.Notes
pull_request_targetis safe forpr-author-assignerandsemantic-commit-lintbecause neither workflow checks out or executes code from the fork's tree. The workflow YAML always runs from the base branch withpull_request_target, so a fork contributor cannot modify the workflow to access secrets via a PR.