@@ -26,24 +26,27 @@ jobs:
26
26
- name : Setup Node.js
27
27
uses : ./.github/actions
28
28
29
- - name : Determine base branch for NX affected
30
- id : set-base
29
+ - name : Debug mainBranch value
30
+ run : |
31
+ echo "Input mainBranch: '${{ github.event.inputs.mainBranch }}'"
32
+
33
+ - name : Determine base for NX affected (if not master)
34
+ if : ${{ github.event.inputs.mainBranch != 'master' }}
31
35
shell : bash
32
36
run : |
33
- if [ "${{ github.event.inputs.mainBranch }}" = "master" ]; then
34
- echo "base=master" >> $GITHUB_OUTPUT
35
- echo "Using base branch 'master'"
36
- else
37
- LAST_TAG=$(git describe --tags --abbrev=0)
38
- LAST_TAG_HASH=$(git rev-parse "$LAST_TAG")
39
- echo "base=$LAST_TAG_HASH" >> $GITHUB_OUTPUT
40
- echo "Using last tag hash: $LAST_TAG_HASH"
41
- fi
42
-
43
- - name : Derive appropriate SHAs for base and head for `nx affected` commands
37
+ LAST_TAG=$(git describe --tags --abbrev=0)
38
+ LAST_TAG_HASH=$(git rev-parse "$LAST_TAG")
39
+ CURRENT_COMMIT=$(git rev-parse HEAD)
40
+ echo "Using last tag hash as NX_BASE: $LAST_TAG_HASH"
41
+ echo "Using current commit as NX_HEAD: $CURRENT_COMMIT"
42
+ echo "NX_BASE=$LAST_TAG_HASH" >> $GITHUB_ENV
43
+ echo "NX_HEAD=$CURRENT_COMMIT" >> $GITHUB_ENV
44
+
45
+ - name : Determine base for NX affected (if master)
46
+ if : ${{ github.event.inputs.mainBranch == 'master' }}
44
47
uses : nrwl/nx-set-shas@v4
45
48
with :
46
- main-branch-name : ${{ steps.set-base.outputs.base }}
49
+ main-branch-name : ${{ github.event.inputs.mainBranch }}
47
50
48
51
- name : Test
49
52
run : npx nx affected --target=test --parallel=3 --passWithNoTests --exclude='*,!tag:type:publish'
0 commit comments