@@ -14,16 +14,15 @@ jobs:
1414 uses : actions/checkout@v4
1515 with :
1616 submodules : ' recursive'
17- - name : Run YAML script
17+ - name : Run generate-variable-docs.py
1818 run : |
1919 python3 flow/scripts/generate-variable-docs.py
20- - name : Run YAML Lint
20+ - name : Run yamlfix check
2121 run : |
22- pip install yamllint==1.35.1
23- yamllint flow/scripts/variables.yaml
22+ yamlfix -c yamlfix.toml flow/scripts/variables.yaml --check
2423
2524 docs-pr-update :
26- name : ' Create PR to update ORFS FlowVariables.md'
25+ name : ' Create PR to update ORFS FlowVariables.md and variables.yaml '
2726 needs :
2827 - docs-test-job
2928 runs-on : ubuntu-latest
3332 - name : Run generate-variable-docs.py
3433 run : |
3534 python3 flow/scripts/generate-variable-docs.py
35+ - name : Run yamlfix
36+ run : |
37+ pip install yamlfix==1.17.0
38+ yamlfix -c yamlfix.toml flow/scripts/variables.yaml
3639 - name : Create branch if diff exists
37- id : docs -update
40+ id : variables -update
3841 run : |
3942 git config --local user.email "github-actions[bot]@users.noreply.github.com"
4043 git config --local user.name "github-actions[bot]"
@@ -43,15 +46,22 @@ jobs:
4346 else
4447 echo "has_update=false" >> "$GITHUB_OUTPUT"
4548 fi
46- git add .
49+ git add flow/scripts/variables.yaml
50+ git add docs/user/FlowVariables.md
4751 git commit --signoff -m "[Docs]: Update ORFS FlowVariables.md"
52+
53+ # Sanity check that no other files are unstaged
54+ if [ -n "$(git status --porcelain)" ]; then
55+ echo "Error: Unstaged changes after commit."
56+ exit 1
57+ fi
4858 - name : Only push if not master
4959 if : " github.event.client_payload.branch != 'master'"
50- id : remote -update-pr
60+ id : variables -update-pr
5161 run : |
5262 git push origin "HEAD:refs/pull/${{ github.event.client_payload.branch }}/head"
53- - name : Create docs update PR
54- if : " steps.remote -update.outputs.has_update == 'true' && github.event.client_payload.branch == 'master'"
63+ - name : Create variables update PR
64+ if : " steps.variables -update.outputs.has_update == 'true' && github.event.client_payload.branch == 'master'"
5565 uses : peter-evans/create-pull-request@v5
5666 with :
5767 token : ${{ github.token }}
0 commit comments