forked from k8s-operatorhub/community-operators
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 2.12 KB
/
upgrade.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
name: "CI Upgrade"
on:
workflow_dispatch:
inputs:
commit-message:
description: 'Commit message prefix'
required: true
default: 'Upgrade CI'
repo:
description: 'Source repsitory'
required: true
default: 'https://github.com/redhat-openshift-ecosystem/community-operators-pipeline'
branch:
description: 'Source branch'
required: true
default: 'ci/latest'
playbook_branch:
description: 'Playbook branch'
required: true
default: 'upstream-community'
cluster:
description: 'Cluster type (k8s, ocp)'
required: true
default: 'k8s'
env:
OPP_INPUT_REPO: "${{ github.event.inputs.repo }}"
OPP_INPUT_BRANCH: "${{ github.event.inputs.branch }}"
OPP_ANSIBLE_PULL_BRANCH: "${{ github.event.inputs.playbook_branch }}"
OPP_SCRIPT_UPGRADE_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-update.sh"
jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip yq
- uses: actions/checkout@v2
with:
token: ${{ secrets.FRAMEWORK_MERGE }}
#persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
# fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Create local changes
env:
CLUSTER_TYPE: ${{ github.event.inputs.cluster }}
run: |
echo "$OPP_INPUT_REPO $OPP_INPUT_BRANCH"
bash <(curl -sL $OPP_SCRIPT_UPGRADE_URL) $CLUSTER_TYPE
- name: Commit files
run: |
git config --local user.email "41898282+framework-automation[bot]@users.noreply.github.com"
git config --local user.name "framework-automation"
git add .
git commit -m "${{ github.event.inputs.commit-message }} ($(date +"%d %b %Y %T"))" -a
git push