-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
36 lines (33 loc) · 1.01 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
name: 'Add STOL apt repository'
description: 'Add STOL apt repository to /etc/apt/sources.list.d'
inputs:
codename:
description: 'Codename for sources.list entry'
required: true
component:
description: 'Component for sources.list entry'
required: false
default: 'main'
update:
description: 'Run apt-get update after adding repository'
required: false
default: 'true'
runs:
using: 'composite'
steps:
- name: Add STOL apt repository
shell: bash
run: |
repo="deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository ${{ inputs.codename }} ${{ inputs.component }}"
list="/etc/apt/sources.list.d/stol-apt-repository.list"
if [ "$(id --user)" -eq "0" ]; then
sudocmd=""
else
sudocmd="sudo"
fi
# Write the repo to list file
echo "$repo" | $sudocmd tee "$list"
# Optionally run apt-get update
if [ "${{ inputs.update }}" == "true" ]; then
$sudocmd apt-get update
fi