Skip to content

Commit b9931ed

Browse files
authored
Update node.js.yml
1 parent c02a546 commit b9931ed

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/node.js.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- name: Get list of remote branches and their hashes
2828
id: get-branches
2929
run: |
30+
set -x
3031
git clone --no-checkout "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" .
3132
git fetch --all
3233
branches="$(git for-each-ref --format='{"name":"%(refname:short)","hash":"%(objectname)"}' refs/remotes/origin/ | sed 's|origin/||' | jq -sc 'map(select(.name != "origin"))')"
@@ -57,9 +58,9 @@ jobs:
5758
id: check_dir
5859
run: |
5960
if [ -d "puck-ntag215-manager" ]; then
60-
echo "exists=true" >> $GITHUB_OUTPUT
61+
echo "exists=true" | tee "$GITHUB_OUTPUT"
6162
else
62-
echo "exists=false" >> $GITHUB_OUTPUT
63+
echo "exists=false" | tee "$GITHUB_OUTPUT"
6364
fi
6465
6566
- name: Use Node.js
@@ -69,7 +70,7 @@ jobs:
6970
- name: Build web app
7071
if: ${{ steps.check_dir.outputs.exists == 'true' }}
7172
run: |
72-
[ -d "puck-ntag215-manager" ]
73+
set -x
7374
cd puck-ntag215-manager
7475
npm install --no-optional
7576
npm run build
@@ -109,16 +110,21 @@ jobs:
109110
branches: ${{ needs.build.outputs.branches }}
110111

111112
run: |
112-
mkdir -p "dist/"
113+
set -x
114+
113115
echo "$branches" | jq -c '.[]' | while read -r branch; do
114116
name="$(echo "$branch" | jq -r '.name')"
115117
hash="$(echo "$branch" | jq -r '.hash')"
116118
119+
echo "Working on branch $name — $hash"
120+
117121
if [ ! -d "./artifacts/$hash" ]; then
122+
echo "Artifact not found for $hash, skipping"
118123
continue
119124
fi
120125
121126
if [ "$name" == "master" ]; then
127+
mkdir -p "dist/"
122128
(cd "./artifacts/$hash" && mv * "../../dist/")
123129
else
124130
mkdir -p "dist/$name"

0 commit comments

Comments
 (0)