-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (61 loc) · 2.03 KB
/
check-version.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
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
name: Check for new versions
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 12 * * *'
workflow_dispatch:
inputs:
sourceCluster:
description: 'Source cluster'
required: false
type: choice
options:
- 'development'
- 'monitoring'
- 'playground'
- 'production'
- 'c2-production'
destinationCluster:
description: 'Destination cluster'
required: false
type: choice
options:
- 'development'
- 'monitoring'
- 'playground'
- 'production'
- 'c2-production'
jobs:
check-version:
name: Check for new versions
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set environments
run: |
PR_BRANCH_TEMP="automatic-version-update"
PR_NAME_TEMP="Automatic Pull Request"
destinationCluster="${{ inputs.destinationCluster }}"
if [ -z $destinationCluster ]; then
echo "PR_BRANCH=${PR_BRANCH_TEMP}-development" >> $GITHUB_ENV
echo "PR_NAME=${PR_NAME_TEMP} - development" >> $GITHUB_ENV
else
echo "PR_BRANCH=${PR_BRANCH_TEMP}-${destinationCluster}" >> $GITHUB_ENV
echo "PR_NAME=${PR_NAME_TEMP} - ${destinationCluster}" >> $GITHUB_ENV
fi
- name: Check version
id: checkversion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SOURCE_CLUSTER: ${{ inputs.sourceCluster }}
DESTINATION_CLUSTER: ${{ inputs.destinationCluster }}
run: .github/workflows/scripts/update_components.sh
- name: Create PR
if: ${{ steps.checkversion.outputs.numberOfChanges > 0 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
PR_BRANCH: ${{ env.PR_BRANCH }}
PR_NAME: ${{ env.PR_NAME }}
run: .github/workflows/scripts/create_pr.sh