-
Notifications
You must be signed in to change notification settings - Fork 3
/
action.yml
91 lines (82 loc) · 2.36 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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Auto Release Tool by Intuit
author: mbround18
description: Run Auto by Intuit on your repo
branding:
icon: arrow-up
color: purple
inputs:
jqVersion:
description: "Version if jq to use"
required: true
default: "1.6"
autoVersion:
description: "Version of auto to install"
required: true
default: "latest"
token:
description: "Admin Pat to use"
required: true
command:
description: "Auto command to run"
required: true
default: "shipit -v"
outputs:
version:
description: "Outputs the auto version."
value: ${{ steps.version.outputs.version }}
runs:
using: "composite"
steps:
- name: Setup Bins
shell: sh
run: |
. "${GITHUB_ACTION_PATH}/scripts/setup.sh"
setup_bin
- name: Setup JQ
shell: sh
if: inputs.autoVersion == 'latest'
run: |
. "${GITHUB_ACTION_PATH}/scripts/setup.sh"
setup_jq "${{ inputs.jqVersion }}"
- name: Get Auto Version
id: auto_version
shell: sh
run: |
. "${GITHUB_ACTION_PATH}/scripts/utils.sh"
VERSION="${{ inputs.autoVersion }}"
if [ "${VERSION}" = "latest" ]; then
LATEST_TAG="$(getLatestVersion "intuit" "auto")"
VERSION=${LATEST_TAG}
fi
echo "auto_version=${VERSION}" >> $GITHUB_OUTPUT
- name: Cache Auto Version
id: cache-auto
uses: actions/cache@v4
with:
path: "${{ env.GITHUB_ACTION_PATH }}/.bin"
key: ${{ steps.auto_version.outputs.auto_version }}-${{ inputs.jqVersion }}
- name: Setup Auto
shell: sh
if: steps.cache-auto.outputs.cache-hit != 'true'
run: |
. "${GITHUB_ACTION_PATH}/scripts/setup.sh"
setup_auto "${{ steps.auto_version.outputs.auto_version }}"
- name: Run Auto
id: auto
shell: bash
env:
GH_TOKEN: "${{ inputs.token }}"
run: . "${GITHUB_ACTION_PATH}/scripts/exec_auto.sh" "${{ inputs.command }}"
- name: Parse Version
shell: bash
id: version
run: |
VERSION="$(. "${GITHUB_ACTION_PATH}/scripts/parse.sh")"
if [ ! -z "${VERSION}" ]; then
{
echo "## Auto Action"
echo "Release Version: \`${VERSION:-"unknown"}\`"
} >> $GITHUB_STEP_SUMMARY
echo "Release Version ${VERSION}"
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT