This repository was archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (43 loc) · 1.53 KB
/
check-upstream.yaml
File metadata and controls
53 lines (43 loc) · 1.53 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
name: Check Upstream Chart Version
on:
schedule:
- cron: '0 8 * * 1'
workflow_dispatch:
jobs:
check-local-version:
name: Check Local Version
runs-on: ubuntu-latest
outputs:
update: ${{ steps.compare.outputs.update }}
version: ${{ steps.compare.outputs.chart_version}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Helm Install
uses: azure/setup-helm@v3
- name: Compare Versions
id: compare
run: |
CHART_PATH="github-arc-operator/helm-charts/actions-runner-controller/Chart.yaml"
LOCAL_VERSION=$(grep -Po "(?<=version: )(\d+.?){3}" $CHART_PATH)
helm repo add actions-runner-controller \
https://actions-runner-controller.github.io/actions-runner-controller
helm repo update
UPSTREAM_VERSION=$(helm search repo actions-runner-controller -o json | jq -r .[0].version)
if [ "$LOCAL_VERSION" == "$UPSTREAM_VERSION" ]; then
echo "Versions match"
echo "update=false" >> $GITHUB_OUTPUT
else
echo "Versions do not match"
echo "update=true" >> $GITHUB_OUTPUT
fi
echo "Local: $LOCAL_VERSION"
echo "Upstream: $UPSTREAM_VERSION"
echo "chart_version=$UPSTREAM_VERSION"
generate-operator:
needs: check-local-version
if: needs.check-local-version.outputs.update == 'true'
uses: ./.github/workflows/generate-operator.yaml
with:
version: ${{ needs.check-local-version.outputs.chart_version }}