forked from puppetlabs/phoenix-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.11 KB
/
Copy pathruntime_targets.yaml
File metadata and controls
42 lines (38 loc) · 1.11 KB
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
on:
workflow_call:
inputs:
PROJECT:
description: "The vanagon runtime project name, without trailing .rb"
required: true
type: string
outputs:
TARGETS:
description: "The platforms for the given vanagon project"
value: ${{ jobs.runtime_targets.outputs.targets }}
name: List runtime targets
jobs:
runtime_targets:
runs-on: ubuntu-latest
name: Runtime targets
steps:
- name: Checkout current PR code
uses: actions/checkout@v4
with:
repository: puppetlabs/ci-job-configs
ref: main
path: ci-job-configs
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Get targets
id: targets
run: |
set -x
cd ci-job-configs
name="${{ inputs.PROJECT }}"
project="${name#-*}"
branch="${name##*-}"
targets=$(ruby resources/scripts/runtime-targets.rb $project $branch | cut -d'#' -f2)
echo "TARGETS=$targets" >> $GITHUB_OUTPUT