-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
43 lines (39 loc) · 1.26 KB
/
action.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
name: Shorebird Patch
description: Create a new patch using the Shorebird CLI
branding:
icon: package
color: green
inputs:
args:
description: The arguments to pass to the Shorebird patch command
required: false
default: ""
platform:
description: The platform for which to create a patch (e.g. android, ios)
required: true
working-directory:
description: The working directory in which to run Shorebird
required: false
default: .
outputs:
patch-number:
description: The number of the patch that was created.
value: ${{ steps.shorebird-patch.outputs.patch-number }}
runs:
using: composite
steps:
- name: 🐦 Shorebird Patch
shell: bash
id: shorebird-patch
working-directory: ${{ inputs.working-directory }}
run: |
shorebird patch ${{ inputs.platform }} ${{ inputs.args }} | tee output.log
GREP_MATCH=$(grep -Ei "Published Patch (.*)" output.log)
if [[ $GREP_MATCH ]]; then
# Strip the non-version-number characters from the line
PATCH_NUMBER=$(echo $GREP_MATCH | sed -E 's/^.+ Published Patch (.*)\!$/\1/')
echo "patch-number=$(echo $PATCH_NUMBER)" >> $GITHUB_OUTPUT
else
echo "Failed to create patch"
exit 1
fi