File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff 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
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
You can’t perform that action at this time.
0 commit comments