Skip to content

Commit 8dde343

Browse files
authored
feat(github-actions): narrow down path scope of build action (#356)
1 parent b90f557 commit 8dde343

File tree

2 files changed

+44
-28
lines changed

2 files changed

+44
-28
lines changed

template/.github/workflows/build.yml.j2

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
tags:
1616
- '[0-9][0-9].[0-9]+.[0-9]+'
1717
pull_request:
18+
paths-ignore:
19+
- 'docs/**'
20+
- '.readme/**'
21+
- '*.md'
1822
merge_group:
1923

2024
env:
@@ -210,34 +214,6 @@ jobs:
210214
cache-all-crates: "true"
211215
- run: cargo test
212216

213-
214-
# Similar to check_charts, this tries to render the README, and see if there are unintended changes.
215-
# This will save us from merging changes to the wrong file (instead of the templated source), and from
216-
# forgetting to render out modifications to the README.
217-
check_readme:
218-
name: Check if committed README is the one we would render from the available parts
219-
runs-on: ubuntu-latest
220-
steps:
221-
- name: Checkout
222-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
223-
with:
224-
submodules: recursive
225-
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # tag=v5.0.0
226-
with:
227-
python-version: '3.11'
228-
- name: Install jinja2-cli
229-
run: pip install jinja2-cli==0.8.2
230-
- name: Regenerate charts
231-
run: make render-readme
232-
- name: Check if committed README were up to date
233-
run: git diff --exit-code
234-
- name: Git Diff showed uncommitted changes
235-
if: ${{ failure() }}
236-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
237-
with:
238-
script: |
239-
core.setFailed('Committed README are not up to date, please make sure to apply them to the templated partials, and re-commit!')
240-
241217
# This job cleans up the CRDs and Helm charts, followed by rebuilding them
242218
# It then runs a `git diff` and fails the entire workflow, if any difference is encountered.
243219
#
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# =============
2+
# This file is automatically generated from the templates in stackabletech/operator-templating
3+
# DON'T MANUALLY EDIT THIS FILE
4+
# =============
5+
# Similar to check_charts, this tries to render the README, and see if there are unintended changes.
6+
# This will save us from merging changes to the wrong file (instead of the templated source), and from
7+
# forgetting to render out modifications to the README.
8+
---
9+
name: Check README
10+
11+
on:
12+
pull_request:
13+
paths:
14+
- '.readme/**'
15+
- 'README.md'
16+
17+
jobs:
18+
check_readme:
19+
name: Check if committed README is the one we would render from the available parts
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
24+
with:
25+
submodules: recursive
26+
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # tag=v5.0.0
27+
with:
28+
python-version: '3.11'
29+
- name: Install jinja2-cli
30+
run: pip install jinja2-cli==0.8.2
31+
- name: Regenerate charts
32+
run: make render-readme
33+
- name: Check if committed README were up to date
34+
run: git diff --exit-code
35+
- name: Git Diff showed uncommitted changes
36+
if: ${{ failure() }}
37+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
38+
with:
39+
script: |
40+
core.setFailed('Committed README are not up to date, please make sure to apply them to the templated partials, and re-commit!')

0 commit comments

Comments
 (0)