-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (50 loc) · 1.54 KB
/
pre-commit.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
54
55
56
57
name: pre-commit
on:
pull_request:
branches:
- main
jobs:
validate-commit:
uses: observeinc/.github/.github/workflows/shared_commit-validation.yaml@main
secrets: inherit
with:
skip: '{}'
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gabe565/setup-helm-docs-action@v1
- uses: pre-commit/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
chart-version-bumps:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup updatecli
uses: updatecli/updatecli-action@v2
- name: Bump any charts that require it
run: |
make updatecli/internal
git diff > diff.txt
if [ -s diff.txt ]; then
echo "Chart version bumps are needed. Please check the PR comments."
echo "The following chart updates are necessary:" > formatted_diff.txt
echo "\`\`\`" >> formatted_diff.txt
cat diff.txt >> formatted_diff.txt
echo "\`\`\`" >> formatted_diff.txt
exit 1
fi
env:
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment PR with needed changes
if: failure()
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
filePath: ./formatted_diff.txt
comment_tag: chart-bump-changes
reactions: eyes