-
Notifications
You must be signed in to change notification settings - Fork 81
39 lines (35 loc) · 1.07 KB
/
pub-score.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Pub Score Checker
on:
pull_request:
branches:
- "main"
push:
branches: ["main"]
jobs:
package-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Versions 🔎
run: |
export VRSN=$(grep 'String version = ' lib/models/agora_rtm_mute_request.dart | sed -e 's,.*\"\(.*\)\";,\1,')
export PUBSPEC_VERSION=$(grep 'version: ' pubspec.yaml | sed -e 's,.*: \(.*\),\1,')
if [ "$PUBSPEC_VERSION" != "$VRSN" ]; then
echo "Version in 'lib/models/agora_rtm_mute_request.dart' does not match pubspec.";
exit 1;
fi
- uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
echo Score is: $TOTAL
if (( $TOTAL < 120 ))
then
echo Pub Score too low.
exit 1
fi