-
Notifications
You must be signed in to change notification settings - Fork 350
74 lines (61 loc) · 2.04 KB
/
update_goldens.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: update_goldens
on:
push:
workflow_dispatch:
inputs:
branch:
description: 'Branch to generate goldens from'
required: true
flutter_version:
description: 'Flutter version to use'
required: true
default: '3.x'
jobs:
generate-and-pr:
runs-on: ubuntu-latest
steps:
- name: Validate branch input
run: |
BRANCH_PATTERN="^[a-zA-Z0-9/_.-]+$"
# Input string (branch name) to be validated
BRANCH_NAME=${{ inputs.branch}}
echo "Checking branch name: $BRANCH_NAME"
# Validate branch name against the regex pattern
if [[ $BRANCH_NAME =~ $BRANCH_PATTERN ]]; then
echo "Branch name is valid."
exit 0
else
echo "Branch name is invalid."
exit 1
fi
- name: Ensure branch is not master
if: ${{ github.event.inputs.branch == 'master' || github.event.inputs.branch == 'origin/master'}}
run: exit 1
- name: 📚 Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.x"
channel: stable
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- name: "Install Tools"
run: |
flutter pub global activate melos
- name: "Bootstrap Workspace"
run: melos bootstrap --verbose
- name: Update Goldens
working-directory: packages/stream_chat_flutter
continue-on-error: true
run: |
flutter test --update-goldens
- name: Commit Changes
id: commit_changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Updating Goldens"
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com