-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (42 loc) · 1.4 KB
/
part_asdf_update.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
on:
workflow_call:
inputs:
plugin:
type: string
required: true
constraint:
type: string
default: ""
required: false
name: "ASDF Update"
jobs:
compile_assets:
name: "${{ inputs.plugin }}"
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: ASDF Install
uses: asdf-vm/actions/install@v2
- name: "Get Newest Version"
id: newestVersion
run: |
LATEST_VERSION=$(asdf latest "${{ inputs.plugin }}" "${{ inputs.constraint }}")
echo "Latest (${{ inputs.constraint }}): $LATEST_VERSION"
echo "LATEST_VERSION=${LATEST_VERSION}" >> $GITHUB_ENV
- name: "Try Installing new version"
run: |
asdf install "${{ inputs.plugin }}" "${{ env.LATEST_VERSION }}"
- name: "Apply latest version to .tool-versions"
run: |
asdf local "${{ inputs.plugin }}" "${{ env.LATEST_VERSION }}"
- uses: peter-evans/create-pull-request@v5
with:
add-paths: '.tool-versions'
commit-message: 'Update ${{ inputs.plugin }} to ${{ env.LATEST_VERSION }}'
title: 'Update ${{ inputs.plugin }} to ${{ env.LATEST_VERSION }}'
branch: 'asdf/${{ inputs.plugin }}/${{ env.LATEST_VERSION }}'
delete-branch: true
labels: 'asdf,enhancement'