-
Notifications
You must be signed in to change notification settings - Fork 36
65 lines (56 loc) · 1.88 KB
/
update_goldens.yaml
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
name: Update Goldens
on:
push:
branches:
- bt/update-goldens
workflow_dispatch:
inputs:
branch:
description: 'Branch to generate goldens from'
required: true
permissions:
contents: write
jobs:
update_goldens:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Validate branch input
run: |
BRANCH_PATTERN="^[a-zA-Z0-9/_-]+$"
# Input string (branch name) to be validated
BRANCH_NAME=${{ github.event.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 main
if: ${{ github.event.inputs.branch == 'main' || github.event.inputs.branch == 'origin/main'}}
run: exit 1
- name: Checkout branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.inputs.branch }}
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.0'
channel: 'stable'
cache: true
- name: Update Goldens
run: |
cd flutter/style_closet
flutter test --update-goldens
continue-on-error: true
- name: Commit Changes
id: commit_changes
uses: stefanzweifel/git-auto-commit-action@12f68633e45c72459cd040c868605f2471c7f63b # v5.0.0
with:
commit_message: "chore: Updating Goldens"
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com