forked from stolostron/multiclusterhub-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 2.03 KB
/
update-crds-2.5.yml
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
# Copyright Contributors to the Open Cluster Management project
name: Update CRDs [2.5]
on:
# trigger from charts
repository_dispatch:
types: [ crd-change ]
# manual trigger
workflow_dispatch:
jobs:
crd-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.HUB_OPERATOR_TOKEN }}
ref: release-2.5
- name: Auto Trigger info
if: github.event_name == 'repository_dispatch'
run: |
echo 'commit_message<<EOF' >> $GITHUB_ENV
echo "Chart update run automatically via $GITHUB_EVENT_NAME" >> $GITHUB_ENV
echo "Initiated by - $GITHUB_ACTOR" >> $GITHUB_ENV
echo "Chart Repo - ${{ github.event.client_payload.repository }}" >> $GITHUB_ENV
echo "Chart Branch - ${{ github.event.client_payload.ref }}" >> $GITHUB_ENV
echo "Chart SHA - ${{ github.event.client_payload.sha }}" >> $GITHUB_ENV
echo "Workflow URL - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Manual Trigger info
if: github.event_name == 'workflow_dispatch'
run: |
echo 'commit_message<<EOF' >> $GITHUB_ENV
echo "Chart update run manually via $GITHUB_EVENT_NAME" >> $GITHUB_ENV
echo "Initiated by - $GITHUB_ACTOR" >> $GITHUB_ENV
echo "Workflow URL - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Update SHA
run: bash hack/scripts/sync-hub-crds.sh
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: ${{ env.commit_message }}
commit_options: '--signoff'
file_pattern: hack/scripts/currentCRDs.txt
skip_fetch: true
commit_user_name: GitHub Actions
commit_user_email: noreply@github.com
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>