forked from gardener/cc-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 2.82 KB
/
Copy pathcomponent-diff.yaml
File metadata and controls
68 lines (65 loc) · 2.82 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Component-Diff
# description: |
# An opinionated workflow to determine the component-diff between the current version (read from
# base-component-descriptor) and the greatest published release-version. Because the component-
# descriptor and OCM releases repository is read from it, the `prepare.yaml` workflow must be
# executed beforehand.
on:
workflow_call:
inputs:
ocm-repositories:
required: false
type: string
description: |
A comma-separated list of OCM-Repository-URLs to use for looking up
OCM-Component-Descriptors. If not passed, the value will be read from the
`prepare-workflow-values` artefact, which is by default emitted by the
`prepare.yaml` workflow (which must have been run prior to calling this workflow for
this to succeed).
outputs:
has-diff:
description: |
Indicates whether (at least) one of the component dependency versions has changed.
value: ${{ jobs.component-diff.outputs.has-diff }}
component-diff:
description: |
The determined component diff between the current and the greatest version, structured
according to `cnudie.util.ComponentDiff`.
value: ${{ jobs.component-diff.outputs.component-diff }}
jobs:
component-diff:
runs-on: ${{ vars.DEFAULT_RUNNER || 'ubuntu-latest' }}
permissions:
contents: read
id-token: write
outputs:
has-diff: ${{ steps.component-diff.outputs.has-diff }}
component-diff: ${{ steps.component-diff.outputs.component-diff }}
steps:
- uses: actions/checkout@v4
- name: collect-component-descriptor
id: component-descriptor
uses: gardener/cc-utils/.github/actions/merge-ocm-fragments@master
with:
component-descriptor-artefact: base-component-descriptor
- name: fetch-prepare-values
if: ${{ inputs.ocm-repositories == '' }}
uses: gardener/cc-utils/.github/actions/download-artifact@master
with:
name: prepare-workflow-values
- name: prepare-prepare-workflow-values
id: prepare
run: |
if [ -f prepare-workflow-values.tar ]; then
tar xf prepare-workflow-values.tar prepare-values.d/ocm-repositories
ocm_repositories="$(cat prepare-values.d/ocm-repositories)"
rm -rf prepare-values.d prepare-workflow-values.tar
else
ocm_repositories="${{ inputs.ocm-repositories }}"
fi
echo "ocm-repositories=${ocm_repositories}" >> ${GITHUB_OUTPUT}
- uses: gardener/cc-utils/.github/actions/component-diff@master
id: component-diff
with:
component-descriptor: ${{ steps.component-descriptor.outputs.component-descriptor }}
ocm-repositories: ${{ steps.prepare.outputs.ocm-repositories }}