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:
17
17
with :
18
18
fetch-depth : 0
19
19
token : ${{ secrets.GITHUB_TOKEN }}
20
- - name : Check for tags
21
- id : check-tags
20
+ - name : Check for tags and conditionally exit
22
21
run : |
23
- # Get tags pointing to the current commit
22
+ # Fetch tags pointing to the current commit
24
23
TAGS=$(git tag --points-at $GITHUB_SHA)
25
24
echo "Tags found: $TAGS"
26
25
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
33
31
- uses : pnpm/action-setup@v4
34
32
with :
35
33
version : 9
40
38
- name : Install Dependencies
41
39
run : pnpm install --no-lockfile
42
40
- name : Deploy Docs
43
- if : env.has_tag == 'false' || (env.has_tag == 'true' && !startsWith(github.ref, 'refs/heads/main'))
44
41
run : pnpm ember deploy production
You can’t perform that action at this time.
0 commit comments