Skip to content

Commit b22c9ae

Browse files
fix(config): update admin test command in package.json and adjust workflow conditions
1 parent 52a7c9a commit b22c9ae

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

.github/workflows/firebase-admin-deploy.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@ jobs:
2727
else
2828
COMMITS="${{ github.sha }}"
2929
fi
30-
30+
3131
should_run=false
3232
for commit in $COMMITS; do
3333
message=$(git log --format=%B -n 1 $commit)
3434
echo "Checking commit: $commit"
3535
echo "Message: $message"
36-
36+
3737
if echo "$message" | grep -E "^[^(]+\((admin|config)\):" > /dev/null; then
3838
should_run=true
3939
break
4040
fi
4141
done
42-
42+
4343
echo "should-run=$should_run" >> $GITHUB_OUTPUT
4444
echo "Admin workflow should run: $should_run"
4545
4646
build-and-deploy:
4747
runs-on: ubuntu-latest
4848
needs: check-commit
4949
if: needs.check-commit.outputs.should-run == 'true'
50-
50+
5151
steps:
5252
- name: Checkout code
5353
uses: actions/checkout@v4
@@ -65,7 +65,7 @@ jobs:
6565
run: npm run lint:admin
6666

6767
- name: Test admin project
68-
run: ng test admin --watch=false --browsers=ChromeHeadless
68+
run: npm run test:admin --watch=false --browsers=ChromeHeadless
6969

7070
- name: Build admin project
7171
run: ng build admin --configuration=production
@@ -105,27 +105,27 @@ jobs:
105105
repo: context.repo.repo,
106106
issue_number: context.issue.number,
107107
});
108-
109-
const botComment = comments.find(comment =>
110-
comment.user.type === 'Bot' &&
108+
109+
const botComment = comments.find(comment =>
110+
comment.user.type === 'Bot' &&
111111
comment.body.includes('🔥 Firebase Admin Preview')
112112
);
113-
113+
114114
const body = `
115115
## 🔥 Firebase Admin Preview Deployed
116-
116+
117117
**Preview URL**: https://angular-admin-blog--pr-${{ github.event.number }}-8t1hsdkv.web.app
118-
118+
119119
Changes in this PR have been deployed to a preview channel.
120120
The preview will be available for 7 days.
121-
121+
122122
### What's included:
123123
- ✅ Admin application build
124124
- ✅ Security headers configured
125125
- ✅ SPA routing enabled
126126
- ✅ Production optimizations
127127
`;
128-
128+
129129
if (botComment) {
130130
await github.rest.issues.updateComment({
131131
owner: context.repo.owner,
@@ -140,4 +140,4 @@ jobs:
140140
issue_number: context.issue.number,
141141
body: body
142142
});
143-
}
143+
}

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"build:all": "ng build shared && ng build web && ng build admin && ng build code-samples-mfe",
99
"watch": "ng build --watch --configuration development",
1010
"test": "ng test web",
11+
"test:admin": "ng test admin",
12+
"test:web": "ng test web",
13+
"test:mfe": "ng test code-samples-mfe",
14+
"test:shared": "ng test shared",
1115
"test:all": "ng test shared && ng test web && ng test admin && ng test code-samples-mfe",
1216
"format": "prettier --write .",
1317
"format:check": "prettier --check .",
@@ -42,7 +46,7 @@
4246
"lint:mfe": "ng lint code-samples-mfe",
4347
"lint:mfe:fix": "ng lint code-samples-mfe --fix",
4448
"commit:web": "echo 'Use: git commit -m \"feat(web): your message\"'",
45-
"commit:admin": "echo 'Use: git commit -m \"feat(admin): your message\"'",
49+
"commit:admin": "echo 'Use: git commit -m \"feat(admin): your message\"'",
4650
"commit:mfe": "echo 'Use: git commit -m \"feat(mfe): your message\"'",
4751
"commit:shared": "echo 'Use: git commit -m \"feat(shared): your message\"'",
4852
"commit:config": "echo 'Use: git commit -m \"chore(config): your message\"'",

0 commit comments

Comments
 (0)