-
Notifications
You must be signed in to change notification settings - Fork 9
37 lines (34 loc) · 1.07 KB
/
get-changed-chart.yaml
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
name: Get single changed chart in last commit
on:
workflow_call:
inputs:
pr_number:
type: number
required: true
outputs:
chart:
description: The name of the changed cart in the last commit
value: ${{ jobs.getChangedChart.outputs.chart }}
found:
description: A chart was changed
value: ${{ jobs.getChangedChart.outputs.found == 'true' }}
jobs:
getChangedCharts:
uses: ./.github/workflows/get-changed-charts.yaml
with:
pr_number: ${{ inputs.pr_number }}
getChangedChart:
runs-on: ubuntu-latest
needs: getChangedCharts
outputs:
chart: ${{ steps.getChangedChart.outputs.chart }}
found: ${{ needs.getChangedCharts.outputs.count == 1 }}
steps:
- id: getChangedChart
name: Get changed chart in PR
if: ${{ needs.getChangedCharts.outputs.count == 1 }}
run: |
set -e
set -o pipefail
changed='${{ needs.getChangedCharts.outputs.charts }}'
echo chart="$(<<<"$changed" jq -r first)" | tee -a "$GITHUB_OUTPUT"