-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
32 lines (28 loc) · 886 Bytes
/
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
name: Git SemVer
description: Installs and runs git-semver
inputs:
script:
description: Shell script to run
required: true
runs:
using: composite
steps:
- id: version
run: |
v="${{ github.action_ref }}"
v=$(echo "${v:1}")
echo "::set-output name=version::$v"
shell: bash
- run: |
v="${{ steps.version.outputs.version }}"
url="https://github.com/carlsberg/git-semver/releases/download/v$v/git-semver_$v_Linux_x86_64.tar.gz"
curl -L "$url" >> git-semver.tar.gz
tar -xvzf git-semver.tar.gz
mkdir $HOME/.local/bin && mv git-semver $HOME/.local/bin
echo $HOME/.local/bin >> $GITHUB_PATH
shell: bash
- run: |
echo '${{ inputs.script }}' >> $HOME/.local/bin/script.sh
chmod +x $HOME/.local/bin/script.sh
$HOME/.local/bin/script.sh
shell: bash