Summary
The label-sync workflow can fail when a pull request does not reference any linked issue in its title or body.
Current Behavior
The composite action .github/actions/label-sync/copy-linked-issue-labels parses the pull request title/body with a grep pipeline inside command substitution while running under set -euo pipefail.
When no linked issue keyword such as closes #123 or fixes #123 is present, grep exits with status 1 before the script reaches the explicit fallback branch that should print No linked issue was found... and exit successfully.
That makes the workflow fail even though the absence of a linked issue should be treated as a no-op.
Failing Surface
.github/workflows/label-sync.yml
.github/actions/label-sync/copy-linked-issue-labels/run.sh
Observed failure:
Prepare all required actions
Run ./.github/actions/label-sync/copy-linked-issue-labels
Run /home/runner/work/dev-tools/dev-tools/./.github/actions/label-sync/copy-linked-issue-labels/run.sh
/home/runner/work/dev-tools/dev-tools/./.github/actions/label-sync/copy-linked-issue-labels/run.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
GH_TOKEN: ***
Expected Behavior
- If the PR body/title does not reference any issue, the action should log that no linked issue was found and exit with status
0.
- The workflow should only attempt label propagation when a linked issue number is actually present.
Acceptance Criteria
copy-linked-issue-labels no longer fails when the PR has no linked issue reference.
- The action still copies labels correctly when an issue reference exists.
- A regression test or equivalent focused verification covers the no-linked-issue path.
Summary
The
label-syncworkflow can fail when a pull request does not reference any linked issue in its title or body.Current Behavior
The composite action
.github/actions/label-sync/copy-linked-issue-labelsparses the pull request title/body with agreppipeline inside command substitution while running underset -euo pipefail.When no linked issue keyword such as
closes #123orfixes #123is present,grepexits with status1before the script reaches the explicit fallback branch that should printNo linked issue was found...and exit successfully.That makes the workflow fail even though the absence of a linked issue should be treated as a no-op.
Failing Surface
.github/workflows/label-sync.yml.github/actions/label-sync/copy-linked-issue-labels/run.shObserved failure:
Expected Behavior
0.Acceptance Criteria
copy-linked-issue-labelsno longer fails when the PR has no linked issue reference.