Skip to content

Commit 6268e12

Browse files
Copilotharupy
andauthored
Fix API_REFERENCE_PREFIX to use dev-- for push events (mlflow#19137)
Signed-off-by: Harutaka Kawamura <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: harupy <[email protected]> Co-authored-by: Harutaka Kawamura <[email protected]>
1 parent f4cf013 commit 6268e12

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

.github/workflows/docs.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,24 @@ jobs:
6868
- uses: ./.github/actions/show-versions
6969
- run: |
7070
npm run convert-notebooks
71+
- name: Set alias
72+
id: alias
73+
env:
74+
EVENT_NAME: ${{ github.event_name }}
75+
PR_NUMBER: ${{ github.event.pull_request.number }}
76+
run: |
77+
if [ "$EVENT_NAME" = "push" ]; then
78+
ALIAS="dev"
79+
else
80+
ALIAS="pr-$PR_NUMBER"
81+
fi
82+
echo "value=$ALIAS" >> $GITHUB_OUTPUT
83+
echo "$ALIAS" > /tmp/alias.txt
84+
cat /tmp/alias.txt
7185
- name: Build docs
7286
env:
7387
GTM_ID: "GTM-TEST"
74-
API_REFERENCE_PREFIX: https://pr-${{ github.event.pull_request.number }}--mlflow-docs-preview.netlify.app/docs/
88+
API_REFERENCE_PREFIX: https://${{ steps.alias.outputs.value }}--mlflow-docs-preview.netlify.app/docs/
7589
run: |
7690
npm run build-all -- --no-r --use-npm
7791
- name: Check API inventory
@@ -105,17 +119,6 @@ jobs:
105119

106120
# `github.event.workflow_run.pull_requests` is empty when a PR is created from a fork:
107121
# https://github.com/orgs/community/discussions/25220#discussioncomment-11001085
108-
- name: Save alias
109-
env:
110-
EVENT_NAME: ${{ github.event_name }}
111-
PR_NUMBER: ${{ github.event.pull_request.number }}
112-
run: |
113-
if [ "$EVENT_NAME" = "push" ]; then
114-
echo "dev" > /tmp/alias.txt
115-
else
116-
echo "pr-$PR_NUMBER" > /tmp/alias.txt
117-
fi
118-
cat /tmp/alias.txt
119122
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
120123
with:
121124
name: alias

0 commit comments

Comments
 (0)