-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcheck_generated_toolbox_rst.yml
More file actions
52 lines (44 loc) · 1.55 KB
/
check_generated_toolbox_rst.yml
File metadata and controls
52 lines (44 loc) · 1.55 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
# Ensure Ansible 'default' files match the Python entrypoint
name: Ansible defaults match
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: '0 */8 * * *'
jobs:
check_generated_rst:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/steps/prepare_minimal_ubuntu_image
- name: "Ensure that Ansible 'default' files match the Python entrypoint"
run: |
./run_toolbox.py repo generate_toolbox_rst_documentation
- name: Show the difference between the commited files and the regenerated Ansible files
run: |
git diff
- name: Fail the test if there is a mismatch between the roles defaults and the Python entrypoints
run: |
changes=$(git diff | wc -l)
if [ "$changes" -ne "0" ]; then
echo "
There is a mismatch between the roles
defaults and the Python entrypoints.
Make sure you run:
./run_toolbox.py repo generate_toolbox_related_files
When making changes to the Python entrypoints.
"
exit 1
fi
- name: Fail if there are untracked files
run: |
if git ls-files --others --exclude-standard | grep .; then
echo "---"
echo "Found untracked files. Make sure to include them in the commit."
exit 1
fi