-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
95 lines (86 loc) · 2.65 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
92
93
94
95
name: Tool Versions Update Action - commit
description: Update tools in your .tool-versions file through a commit
branding:
icon: arrow-up-circle
color: blue
inputs:
branch:
description: |
The branch to commit to.
required: false
default: ${{ github.head_ref }}
commit-message:
description: |
The message to use for commits.
required: false
default: Update .tool-versions
max:
description: |
The maximum number of tools to update. 0 indicates no maximum.
required: false
default: 0
not:
description: |
A comma-separated list of tools that should NOT be updated.
required: false
default: ""
only:
description: |
A comma-separated list of tools that should be updated, ignoring others.
required: false
default: ""
plugins:
description: |
A newline-separated list of "plugin url" pairs that should be installed.
If omitted the default plugins will be available.
required: false
default: ""
token:
description: |
The $GITHUB_TOKEN or a repository scoped Personal Access Token (PAT).
required: false
default: ${{ github.token }}
outputs:
commit-sha:
description: The SHA identifier of the created commit.
value: ${{ steps.create-commit.outputs.commit_hash }}
did-update:
description: true if at least one tool was updated, false otherwise.
value: ${{ steps.update.outputs.did-update }}
runs:
using: composite
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # pin@v3
with:
ref: ${{ github.head_ref }}
token: ${{ inputs.token }}
- name: Setup asdf
if: ${{ inputs.plugins != '' }}
uses: asdf-vm/actions/setup@6a442392015fbbdd8b48696d41e0051b2698b2e4 # pin@v2
- name: Configure asdf plugins
if: ${{ inputs.plugins != '' }}
shell: bash
run: $GITHUB_ACTION_PATH/../bin/install-plugins.sh
env:
LIST: ${{ inputs.plugins }}
- name: Install asdf
uses: asdf-vm/actions/install@6a442392015fbbdd8b48696d41e0051b2698b2e4 # pin@v2
- name: Look for updates
id: update
shell: bash
run: $GITHUB_ACTION_PATH/../bin/update.sh
env:
MAX: ${{ inputs.max }}
NOT: ${{ inputs.not }}
ONLY: ${{ inputs.only }}
- name: Create commit
id: create-commit
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # pin@v4
with:
skip_dirty_check: false
# Branch
branch: ${{ inputs.branch }}
# Commit
commit_message: ${{ inputs.commit-message }}
file_pattern: .tool-versions