forked from firebase/firebase-cpp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.35 KB
/
update-custom-runner.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
name: Update custom GitHub runners
on:
workflow_dispatch:
inputs:
runner_list:
description: 'Runner hostname to update (comma-separated)'
default: 'fplmac1,fplmac2'
required: true
update_tools:
description: 'Update tools?'
default: '1'
required: true
update_os:
description: 'Update OS?'
default: '0'
required: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
update_custom_runners:
name: update-custom-runner-${{ matrix.runner_hostname }}
runs-on: [self-hosted, '${{ matrix.runner_hostname }}' ]
if: ${{ github.event.input.runner_list }}
strategy:
matrix:
runner_hostname: ${{ github.event.input.runner_list }}
steps:
- name: Update tools
if: ${{ github.event.inputs.update_tools }}
shell: bash
run: |
echo "npm install -g firebase-tools"
- name: Check for OS updates
shell: bash
run: |
if softwareupdate -l -r | grep -q 'No new software available'
then
echo "::warning ::No OS updates available."
else
echo "softwareupdate -l -r | tr '\n' '|' | sed 's/|/%0A/g' | sed "
- name: Update OS
if: ${{ github.event.inputs.update_os }}
shell: bash
run: |
echo "softwareupdate -i -r -f"