|
1 | 1 | name: ORFS variables.yaml tester and linter |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | 4 | pull_request: |
6 | 5 |
|
7 | 6 | jobs: |
|
22 | 21 | run: | |
23 | 22 | pip install yamlfix==1.17.0 |
24 | 23 | yamlfix -c yamlfix.toml flow/scripts/variables.yaml --check |
25 | | -
|
26 | | - docs-pr-update: |
27 | | - name: 'Create PR to update ORFS FlowVariables.md and variables.yaml' |
28 | | - if: github.event_name == 'push' |
29 | | - needs: |
30 | | - - docs-test-job |
31 | | - runs-on: ubuntu-latest |
32 | | - steps: |
33 | | - - name: Checkout repository |
34 | | - uses: actions/checkout@v4 |
35 | | - - name: Run generate-variables-docs.py |
36 | | - run: | |
37 | | - python3 flow/scripts/generate-variables-docs.py |
38 | | - - name: Run yamlfix |
39 | | - run: | |
40 | | - pip install yamlfix==1.17.0 |
41 | | - yamlfix -c yamlfix.toml flow/scripts/variables.yaml |
42 | | - - name: Create branch if diff exists |
43 | | - id: variables-update |
44 | | - run: | |
45 | | - git config --local user.email "github-actions[bot]@users.noreply.github.com" |
46 | | - git config --local user.name "github-actions[bot]" |
47 | | - if [ -n "$(git status --porcelain)" ]; then |
48 | | - echo "has_update=true" >> "$GITHUB_OUTPUT" |
49 | | - else |
50 | | - echo "has_update=false" >> "$GITHUB_OUTPUT" |
51 | | - fi |
52 | | - git add flow/scripts/variables.yaml |
53 | | - git add docs/user/FlowVariables.md |
54 | | - git commit --signoff -m "[Docs]: Update ORFS FlowVariables.md" |
55 | | -
|
56 | | - # Sanity check that no other files are unstaged |
57 | | - if [ -n "$(git status --porcelain)" ]; then |
58 | | - echo "Error: Unstaged changes after commit." |
59 | | - exit 1 |
60 | | - fi |
61 | | - - name: Only push if not master |
62 | | - if: "github.event.client_payload.branch != 'master'" |
63 | | - id: variables-update-pr |
64 | | - run: | |
65 | | - git push origin "HEAD:refs/pull/${{ github.event.client_payload.branch }}/head" |
66 | | - - name: Create variables update PR |
67 | | - if: "steps.variables-update.outputs.has_update == 'true' && github.event.client_payload.branch == 'master'" |
68 | | - uses: peter-evans/create-pull-request@v5 |
69 | | - with: |
70 | | - token: ${{ github.token }} |
71 | | - signoff: true |
72 | | - delete-branch: true |
73 | | - title: "[BOT] Update ORFS variables" |
74 | | - reviewers: | |
75 | | - vvbandeira |
76 | | - maliberty |
77 | | - draft: true |
78 | | - branch: bot-update-variables |
79 | | - commit-message: | |
80 | | - [BOT] Update ORFS variables |
0 commit comments