Skip to content

Commit 6037f9e

Browse files
Update addon-docs.yml
1 parent b59a354 commit 6037f9e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

.github/workflows/addon-docs.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919
token: ${{ secrets.GITHUB_TOKEN }}
20-
- name: Check for tags
21-
id: check-tags
20+
- name: Check for tags and conditionally exit
2221
run: |
23-
# Get tags pointing to the current commit
22+
# Fetch tags pointing to the current commit
2423
TAGS=$(git tag --points-at $GITHUB_SHA)
2524
echo "Tags found: $TAGS"
2625
27-
# Save whether tags exist as an output variable
28-
if [ -z "$TAGS" ]; then
29-
echo "has_tag=false" >> $GITHUB_ENV
30-
else
31-
echo "has_tag=true" >> $GITHUB_ENV
32-
fi
26+
# Check if a tag exists and if the ref is 'refs/heads/main' or 'refs/heads/master'
27+
if [ -n "$TAGS" ] && ([[ "${GITHUB_REF}" == "refs/heads/main" ]] || [[ "${GITHUB_REF}" == "refs/heads/master" ]]); then
28+
echo "Commit has a tag and is pushed to the main or master branch. Exiting."
29+
exit 0
30+
fi
3331
- uses: pnpm/action-setup@v4
3432
with:
3533
version: 9
@@ -40,5 +38,4 @@ jobs:
4038
- name: Install Dependencies
4139
run: pnpm install --no-lockfile
4240
- name: Deploy Docs
43-
if: env.has_tag == 'false' || (env.has_tag == 'true' && !startsWith(github.ref, 'refs/heads/main'))
4441
run: pnpm ember deploy production

0 commit comments

Comments
 (0)