Skip to content

Commit 7bde55c

Browse files
authored
Do docs check in one step (#7289)
1 parent 98d0b84 commit 7bde55c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/release-staging.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,16 @@ jobs:
134134
https://api.github.com/repos/firebase/firebase-js-sdk/dispatches
135135
- name: Check for changes requiring a reference doc publish
136136
id: docs-check
137+
# If a diff is found (length of DIFF_CONTENTS > 0) it will write DOCS_NEEDED=true
137138
run: |
138139
LAST_PUBLISHED_VERSION=$(npm info firebase version)
139-
git diff --exit-code firebase@$LAST_PUBLISHED_VERSION HEAD docs-devsite
140-
- name: No diff, docs not needed
141-
if: ${{ success() }}
142-
run: echo "DOCS_NEEDED=false" >> $GITHUB_STATE
143-
- name: Diff returned something, docs are needed
144-
if: ${{ failure() }}
145-
run: echo "DOCS_NEEDED=true" >> $GITHUB_STATE
140+
DIFF_CONTENTS=$(git diff firebase@$LAST_PUBLISHED_VERSION HEAD docs-devsite)
141+
if [ -n "$DIFF_CONTENTS" ]
142+
then
143+
echo "DOCS_NEEDED=true" >> $GITHUB_OUTPUT
144+
else
145+
echo "DOCS_NEEDED=false" >> $GITHUB_OUTPUT
146+
fi
146147
- name: Log to release tracker
147148
# Sends release information to cloud functions endpoint of release tracker.
148149
if: ${{ always() }}

0 commit comments

Comments
 (0)