-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yaml
More file actions
83 lines (72 loc) · 2.46 KB
/
action.yaml
File metadata and controls
83 lines (72 loc) · 2.46 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: 'Bump Chart Version'
description: 'Automatically Bump Helm Chart Version'
author: beehivewarrior
branding:
icon: anchor
color: blue
inputs:
chart_name:
description: 'Chart to be bumped'
required: true
bump_strategy:
description: 'How the chart should be bumped'
required: false
default: 'PATCH'
outputs:
version_bumped:
description: Boolean indicating that the version was incremented.
value: ${{ steps.bump-chart-version.outputs.version_bumped }}
runs:
using: composite
steps:
- uses: actions/checkout@v3
if: github.actor != 'first-mate-bot'
with:
fetch-depth: '2'
- name: 'Check if Chart Changed'
if: github.actor != 'first-mate-bot'
uses: tj-actions/changed-files@v23
id: 'chart-changed'
with:
files: |
${{ inputs.chart_name }}
- name: "Bump Chart Version"
id: bump
if: github.actor != 'first-mate-bot' && steps.chart-changed.outputs.any_modified == 'true'
env:
BUMP_STRATEGY: ${{ inputs.bump_strategy }}
CHART_NAME: ${{ inputs.chart_name }}
shell: bash
run: |
entrypoint="import sys;
import subprocess;
from pathlib import Path;
MAIN_SCRIPT = Path(r'${GITHUB_ACTION_PATH}') / 'auto_bump' / 'main.py';
proc = subprocess.run([sys.executable, str(MAIN_SCRIPT)]);
sys.exit(proc.returncode)
"
if [ "$RUNNER_OS" == "Windows" ]; then
echo $entrypoint | python
else
echo $entrypoint | python3
fi
echo "::set-output name=version_bumped::true"
- name: "Check For Bump"
id: review
if: github.actor != 'first-mate-bot' && steps.chart-changed.outputs.any_modified == 'true'
env:
BUMP_STRATEGY: ${{ inputs.bump_strategy }}
FIRST_MATE_MESSAGE: |
cat << EOF
Bumped Helm Chart Version From "$FIRST_MATE_OLD_VERSION" to "$FIRST_MATE_NEW_VERSION"
Changes committed by ${{ github.actor }} in commit: ${{ github.event.after }} altered the Helm Chart.
I updated the Chart.yaml file using the "BUMP_STRATEGY" strategy.
Signed-off-by: first-mate-bot[bot] <bot@firstmate.dev>
EOF
run: |
if [[`git status --porcelain` ]]; then
git config --local user.name "first-mate-bot"
git config --local user.email "bot@firstmate.dev"
git add -A
git commit -m "$FIRST_MATE_MESSAGE"
shell: bash