Skip to content

Commit 950f232

Browse files
committed
feat(ci): add job summary to check-should-publish
Write a summary table with branch, event, deploy, and allowlist status. Include a callout explaining why artifacts will or will not be published.
1 parent 72a5d3c commit 950f232

1 file changed

Lines changed: 29 additions & 6 deletions

File tree

.github/workflows/docs-build.yaml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,37 @@ jobs:
9999
100100
# Check if branch is in allowlist
101101
if echo "$ALLOWLISTED_BRANCHES" | grep -qxF "$BRANCH_INPUT"; then
102-
echo "should_publish=true" >> "$GITHUB_OUTPUT"
103-
echo "Branch '$BRANCH_INPUT' is allowlisted for publishing"
102+
SHOULD_PUBLISH="true"
104103
else
105-
echo "should_publish=false" >> "$GITHUB_OUTPUT"
106-
echo "Branch '$BRANCH_INPUT' is not allowlisted for publishing"
107-
echo "Allowlisted branches:"
108-
echo "$ALLOWLISTED_BRANCHES" | sed 's/^/ - /'
104+
SHOULD_PUBLISH="false"
109105
fi
106+
echo "should_publish=$SHOULD_PUBLISH" >> "$GITHUB_OUTPUT"
107+
108+
# Write job summary
109+
{
110+
echo "## Check Should Publish"
111+
echo ""
112+
echo "| Setting | Value |"
113+
echo "|---------|-------|"
114+
echo "| **Branch** | \`$BRANCH_INPUT\` |"
115+
echo "| **Event** | \`$EVENT_NAME\` |"
116+
echo "| **Deploy build** | $IS_DEPLOY |"
117+
echo "| **Allowlisted** | $SHOULD_PUBLISH |"
118+
echo ""
119+
120+
if [ "$EVENT_NAME" = "pull_request" ]; then
121+
echo "-> **Build only** -- pull request; artifacts are not published."
122+
elif [ "$SHOULD_PUBLISH" = "true" ]; then
123+
echo "-> **Will publish** -- branch is allowlisted; artifacts will be built, combined, and uploaded."
124+
else
125+
echo "-> **Skipping publish** -- branch is not in the allowlist (\`.github/configs/docs-branches.yaml\`)."
126+
echo ""
127+
echo "Allowlisted branches:"
128+
echo "$ALLOWLISTED_BRANCHES" | while read -r b; do
129+
echo "- \`$b\`"
130+
done
131+
fi
132+
} >> "$GITHUB_STEP_SUMMARY"
110133
111134
html-docs:
112135
name: "Build HTML Docs"

0 commit comments

Comments
 (0)