|
1 | 1 | --- |
2 | | - # GitHub Actions workflow to update the Helm chart dependencies on our modules. |
3 | | - # |
4 | | - # IMPORTANT: This workflow is called by other workflows in our DevOps Stack repositories and it is centralized here in |
5 | | - # order to be easily maintained across modules. Because of this, please make sure you're not introducing any breaking |
6 | | - # changes when modifying this workflow. |
7 | | - |
8 | | - name: "modules-chart-update" |
9 | | - |
10 | | - on: |
11 | | - workflow_call: |
12 | | - inputs: |
13 | | - update-strategy: |
14 | | - description: "Upgrade strategy to use. Valid values are 'major', 'minor' or 'patch'" |
15 | | - type: string |
16 | | - required: true |
17 | | - excluded-dependencies: |
18 | | - description: "Comma-separated list of dependencies to exclude from the update (i.e. 'dependency1,dependency2,dependency3')" |
19 | | - type: string |
20 | | - required: false |
21 | | - default: "" |
22 | | - dry-run: |
23 | | - description: "Whether to run the update in dry-run mode or not" |
24 | | - type: boolean |
25 | | - required: false |
26 | | - default: false |
27 | | - |
28 | | - jobs: |
29 | | - list-charts: |
30 | | - runs-on: ubuntu-latest |
31 | | - outputs: |
32 | | - charts: ${{ steps.find-charts.outputs.charts }} |
33 | | - |
34 | | - steps: |
35 | | - - name: "Check out the repository" |
36 | | - uses: actions/checkout@v3 |
37 | | - |
38 | | - - name: "List charts in the ./charts folder" |
39 | | - id: find-charts |
40 | | - run: cd charts && echo "charts=$(find . -maxdepth 2 -name 'Chart.yaml' -exec dirname {} \; | sed 's|^\./||' | sort -u | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT |
41 | | - |
42 | | - chart-update: |
43 | | - runs-on: ubuntu-latest |
44 | | - |
45 | | - needs: list-charts |
46 | | - |
47 | | - # Pass the PR number output to activate the add-pr-to-project job only if a PR is created. |
48 | | - outputs: |
49 | | - minor-pr-number: ${{ steps.minor-pr.outputs.pull-request-number }} |
50 | | - major-pr-number: ${{ steps.major-pr.outputs.pull-request-number }} |
51 | | - |
52 | | - strategy: |
53 | | - matrix: |
54 | | - chart-name: ${{ fromJson(needs.list-charts.outputs.charts) }} |
55 | | - |
56 | | - # Define global settings for both PR steps. |
| 2 | +# GitHub Actions workflow to update the Helm chart dependencies on our modules. |
| 3 | +# |
| 4 | +# IMPORTANT: This workflow is called by other workflows in our DevOps Stack repositories and it is centralized here in |
| 5 | +# order to be easily maintained across modules. Because of this, please make sure you're not introducing any breaking |
| 6 | +# changes when modifying this workflow. |
| 7 | + |
| 8 | +name: "modules-chart-update" |
| 9 | + |
| 10 | +on: |
| 11 | + workflow_call: |
| 12 | + inputs: |
| 13 | + update-strategy: |
| 14 | + description: "Upgrade strategy to use. Valid values are 'major', 'minor' or 'patch'" |
| 15 | + type: string |
| 16 | + required: true |
| 17 | + excluded-dependencies: |
| 18 | + description: "Comma-separated list of dependencies to exclude from the update (i.e. 'dependency1,dependency2,dependency3')" |
| 19 | + type: string |
| 20 | + required: false |
| 21 | + default: "" |
| 22 | + dry-run: |
| 23 | + description: "Whether to run the update in dry-run mode or not" |
| 24 | + type: boolean |
| 25 | + required: false |
| 26 | + default: false |
| 27 | + |
| 28 | +jobs: |
| 29 | + list-charts: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + |
| 32 | + outputs: |
| 33 | + charts: ${{ steps.find-charts.outputs.charts }} |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: "Check out the repository" |
| 37 | + uses: actions/checkout@v3 |
| 38 | + |
| 39 | + - name: "List charts in the ./charts folder" |
| 40 | + id: find-charts |
| 41 | + run: cd charts && echo "charts=$(find . -maxdepth 2 -name 'Chart.yaml' -exec dirname {} \; | sed 's|^\./||' | sort -u | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT |
| 42 | + |
| 43 | + chart-update: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + |
| 46 | + needs: list-charts |
| 47 | + |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + chart-name: ${{ fromJson(needs.list-charts.outputs.charts) }} |
| 51 | + |
| 52 | + # Define global settings for both PR steps. |
| 53 | + env: |
| 54 | + author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" |
| 55 | + |
| 56 | + steps: |
| 57 | + - name: "Check out the repository" |
| 58 | + uses: actions/checkout@v3 |
| 59 | + |
| 60 | + - name: "Upgrade Helm chart dependencies" |
| 61 | + id: deps-update |
| 62 | + uses: camptocamp/helm-dependency-update-action@v0.4.0 |
| 63 | + with: |
| 64 | + chart-path: "charts/${{ matrix.chart-name }}" |
| 65 | + readme-path: "README.adoc" |
| 66 | + excluded-dependencies: ${{ inputs.excluded-dependencies }} |
| 67 | + update-strategy: "${{ inputs.update-strategy }}" |
| 68 | + dry-run: "${{ inputs.dry-run }}" |
| 69 | + |
| 70 | + - name: "Create Pull Request for a minor/patch update" |
| 71 | + if: ${{ !inputs.dry-run && steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type != 'major' }} |
| 72 | + id: minor-pr |
| 73 | + uses: peter-evans/create-pull-request@v5 |
57 | 74 | env: |
58 | | - committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" |
59 | | - |
60 | | - steps: |
61 | | - - name: "Check out the repository" |
62 | | - uses: actions/checkout@v3 |
63 | | - |
64 | | - - name: "Upgrade Helm chart dependencies" |
65 | | - id: deps-update |
66 | | - uses: camptocamp/helm-dependency-update-action@v0.4.0 |
67 | | - with: |
68 | | - chart-path: "charts/${{ matrix.chart-name }}" |
69 | | - readme-path: "README.adoc" |
70 | | - excluded-dependencies: ${{ inputs.excluded-dependencies }} |
71 | | - update-strategy: "${{ inputs.update-strategy }}" |
72 | | - dry-run: "${{ inputs.dry-run }}" |
73 | | - |
74 | | - - name: "Create Pull Request for a minor/patch update" |
75 | | - if: ${{ !inputs.dry-run && steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type != 'major' }} |
76 | | - id: minor-pr |
77 | | - uses: peter-evans/create-pull-request@v3 |
78 | | - env: |
79 | | - pr-title: "feat(chart): ${{ steps.deps-update.outputs.update-type }} update of dependencies on ${{ matrix.chart-name }} chart" |
80 | | - branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-${{ matrix.chart-name }}" |
81 | | - labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}" |
82 | | - |
83 | | - with: |
84 | | - commit-message: ${{ env.pr-title }} |
85 | | - committer: ${{ env.committer }} |
86 | | - branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-${{ matrix.chart-name }}" |
87 | | - title: ${{ env.pr-title }} |
88 | | - labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}" |
89 | | - body: | |
90 | | - :robot: I have updated the chart *beep* *boop* |
91 | | - --- |
92 | | -
|
93 | | - ## Description of the changes |
94 | | -
|
95 | | - This PR updates the dependencies of the **${{ matrix.chart-name }}** Helm chart. |
96 | | - |
97 | | - The maximum version bump was a **${{ steps.deps-update.outputs.update-type }}** step. |
98 | | -
|
99 | | - - name: "Create Pull Request for a major update" |
100 | | - if: ${{ !inputs.dry-run && steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type == 'major' }} |
101 | | - id: major-pr |
102 | | - uses: peter-evans/create-pull-request@v3 |
103 | | - env: |
104 | | - pr-title: "feat!(chart): major update of dependencies on ${{ matrix.chart-name }} chart" |
105 | | - with: |
106 | | - commit-message: ${{ env.pr-title }} |
107 | | - committer: ${{ env.committer }} |
108 | | - branch: "chart-autoupdate-major-${{ matrix.chart-name }}" |
109 | | - title: ${{ env.pr-title }} |
110 | | - labels: "chart-autoupdate-major" |
111 | | - body: | |
112 | | - :robot: I have updated the chart *beep* *boop* |
113 | | - --- |
114 | | -
|
115 | | - ## Description of the changes |
116 | | -
|
117 | | - This PR updates the dependencies of the **${{ matrix.chart-name }}** Helm chart. . |
118 | | -
|
119 | | - :warning: This was a **major** update! Please check the changelog of the updated dependencies and **take notice of any breaking changes before merging**. :warning: |
| 75 | + pr-title: "feat(chart): ${{ steps.deps-update.outputs.update-type }} update of dependencies on ${{ matrix.chart-name }} chart" |
| 76 | + branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-${{ matrix.chart-name }}" |
| 77 | + labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}" |
| 78 | + with: |
| 79 | + commit-message: ${{ env.pr-title }} |
| 80 | + author: ${{ env.author }} |
| 81 | + committer: ${{ env.author }} |
| 82 | + branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-${{ matrix.chart-name }}" |
| 83 | + title: ${{ env.pr-title }} |
| 84 | + labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}" |
| 85 | + body: | |
| 86 | + :robot: I have updated the chart *beep* *boop* |
| 87 | + --- |
| 88 | +
|
| 89 | + ## Description of the changes |
| 90 | +
|
| 91 | + This PR updates the dependencies of the **${{ matrix.chart-name }}** Helm chart. |
| 92 | + |
| 93 | + The maximum version bump was a **${{ steps.deps-update.outputs.update-type }}** step. |
| 94 | +
|
| 95 | + - name: "Create Pull Request for a major update" |
| 96 | + if: ${{ !inputs.dry-run && steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type == 'major' }} |
| 97 | + id: major-pr |
| 98 | + uses: peter-evans/create-pull-request@v5 |
| 99 | + env: |
| 100 | + # This step does not have a branch and labels environment variable, because it is forcefully a major update, |
| 101 | + # unlike the previous step, which can either be a patch, minor or major update. |
| 102 | + pr-title: "feat!(chart): major update of dependencies on ${{ matrix.chart-name }} chart" |
| 103 | + with: |
| 104 | + commit-message: ${{ env.pr-title }} |
| 105 | + author: ${{ env.author }} |
| 106 | + committer: ${{ env.author }} |
| 107 | + branch: "chart-autoupdate-major-${{ matrix.chart-name }}" |
| 108 | + title: ${{ env.pr-title }} |
| 109 | + labels: "chart-autoupdate-major" |
| 110 | + body: | |
| 111 | + :robot: I have updated the chart *beep* *boop* |
| 112 | + --- |
| 113 | +
|
| 114 | + ## Description of the changes |
| 115 | +
|
| 116 | + This PR updates the dependencies of the **${{ matrix.chart-name }}** Helm chart. . |
| 117 | +
|
| 118 | + :warning: This was a **major** update! Please check the changelog of the updated dependencies and **take notice of any breaking changes before merging**. :warning: |
0 commit comments