Skip to content

Commit 525fba7

Browse files
committed
Pack creation: load help from base reference
For pull requests the current process attempts to load the help from the equivalent ref in the help repo. As most PRs do not add an equivalent branch on the help repo, this means that most PRs do not load any help at all, and the constructed artifacts are missing help. This is problematic during the release process, where we appear to use the artifacts built from the PR event, instead of the artifacts built from the branch itself, therefore using artifacts without any help included. This commit modifies the behaviour to fetch the help for the base ref for the pull request or merge group. This should ensure that help files are always loaded, regardless of where the artifacts are built.
1 parent 041150a commit 525fba7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/code-scanning-pack-gen.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@ jobs:
6868
- name: Determine ref for external help files
6969
id: determine-ref
7070
run: |
71-
if [[ $GITHUB_EVENT_NAME == "pull_request" || $GITHUB_EVENT_NAME == "merge_group" ]]; then
72-
echo "EXTERNAL_HELP_REF=$GITHUB_HEAD_REF" >> "$GITHUB_ENV"
71+
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
72+
EXTERNAL_HELP_REF="${{ github.event.pull_request.base.ref }}"
73+
elif [[ $GITHUB_EVENT_NAME == "merge_group" ]]; then
74+
EXTERNAL_HELP_REF="${{ github.event.merge_group.base_ref }}"
7375
else
74-
echo "EXTERNAL_HELP_REF=$GITHUB_REF" >> "$GITHUB_ENV"
76+
EXTERNAL_HELP_REF="$GITHUB_REF"
7577
fi
78+
echo "EXTERNAL_HELP_REF=$EXTERNAL_HELP_REF" >> "$GITHUB_ENV"
7679
echo "Using ref $EXTERNAL_HELP_REF for external help files."
7780
7881
- name: Checkout external help files

0 commit comments

Comments
 (0)