Skip to content

Commit 193ade3

Browse files
committed
5564: Lint yml files
1 parent ac2a23a commit 193ade3

35 files changed

Lines changed: 877 additions & 883 deletions

.github/workflows/apispec.yaml

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,115 @@
11
name: API Spec review
22

33
env:
4-
COMPOSE_USER: root
4+
COMPOSE_USER: root
55

66
on:
7-
pull_request:
7+
pull_request:
88

99
jobs:
10-
api-spec-updated:
11-
name: Ensure committed API specification is up to date
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v5
16-
with:
17-
fetch-depth: 2
18-
19-
- name: Create docker network
20-
run: |
21-
docker network create frontend
22-
23-
- name: Composer install
24-
run: |
25-
docker compose run --rm phpfpm composer install
26-
27-
- name: Export API specification
28-
run: |
29-
docker compose run --rm phpfpm bin/console api:openapi:export --yaml --output=public/api-spec-v1.yaml --no-interaction
30-
31-
- name: Check for changes in specification
32-
id: git-diff-spec
33-
continue-on-error: true
34-
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.yaml
35-
36-
- name: Comment PR
37-
if: steps.git-diff-spec.outcome == 'failure'
38-
env:
39-
GH_TOKEN: ${{ github.token }}
40-
run: |
41-
echo '## 🛑 Exported API specification file not up to date' > var/comment.md
42-
echo '' >> var/comment.md
43-
echo 'Please run `composer update-api-spec` to export the API specification. Then commit and push the changes.' >> var/comment.md
44-
gh pr comment ${{ github.event.pull_request.number }} --body-file var/comment.md --create-if-none --edit-last
45-
46-
- name: Fail job, api spec is not up to date
47-
if: steps.git-diff-spec.outcome == 'failure'
48-
run: |
49-
exit 1
50-
51-
detect-breaking-changes:
52-
name: Detect breaking changes in API specification
53-
runs-on: ubuntu-latest
54-
needs: [api-spec-updated]
55-
steps:
56-
- name: Check out BASE rev
57-
uses: actions/checkout@v5
58-
with:
59-
ref: ${{ github.base_ref }}
60-
path: base
61-
62-
- name: Check out HEAD rev
63-
uses: actions/checkout@v5
64-
with:
65-
ref: ${{ github.head_ref }}
66-
path: head
67-
68-
- name: Run OpenAPI Changed (from HEAD rev)
69-
id: api-changed
70-
continue-on-error: true
71-
uses: docker://openapitools/openapi-diff:latest
72-
with:
73-
args: --fail-on-changed base/public/api-spec-v1.yaml head/public/api-spec-v1.yaml --markdown api-spec-changed.md
74-
75-
- name: Run OpenAPI Incompatible (from HEAD rev)
76-
id: api-incompatible
77-
continue-on-error: true
78-
uses: docker://openapitools/openapi-diff:latest
79-
with:
80-
args: --fail-on-incompatible base/public/api-spec-v1.yaml head/public/api-spec-v1.yaml --markdown api-spec-incompatible.md
81-
82-
- name: Comment PR with no changes
83-
if: steps.api-changed.outcome == 'success' && steps.api-incompatible.outcome == 'success'
84-
working-directory: head
85-
env:
86-
GH_TOKEN: ${{ github.token }}
87-
run: |
88-
gh pr comment ${{ github.event.pull_request.number }} --body "✅ **No changes detected in API specification**" --create-if-none --edit-last
89-
90-
- name: Comment PR with non-breaking changes
91-
if: steps.api-changed.outcome == 'failure' && steps.api-incompatible.outcome == 'success'
92-
working-directory: head
93-
env:
94-
GH_TOKEN: ${{ github.token }}
95-
run: |
96-
echo "## ⚠️ Non-Breaking changes detected in API specification" > ../comment.md
97-
echo "" >> ../comment.md
98-
cat ../api-spec-changed.md >> ../comment.md
99-
gh pr comment ${{ github.event.pull_request.number }} --body-file ../comment.md --create-if-none --edit-last
100-
101-
- name: Comment PR with breaking changes
102-
if: steps.api-incompatible.outcome == 'failure'
103-
working-directory: head
104-
env:
105-
GH_TOKEN: ${{ github.token }}
106-
run: |
107-
echo "## 🛑 Breaking changes detected in API specification" > ../comment.md
108-
echo "" >> ../comment.md
109-
cat ../api-spec-incompatible.md >> ../comment.md
110-
gh pr comment ${{ github.event.pull_request.number }} --body-file ../comment.md --create-if-none --edit-last
111-
112-
- name: Fail if breaking changes detected
113-
if: steps.api-incompatible.outcome == 'failure'
114-
run: |
115-
exit 1
10+
api-spec-updated:
11+
name: Ensure committed API specification is up to date
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Create docker network
20+
run: |
21+
docker network create frontend
22+
23+
- name: Composer install
24+
run: |
25+
docker compose run --rm phpfpm composer install
26+
27+
- name: Export API specification
28+
run: |
29+
docker compose run --rm phpfpm bin/console api:openapi:export --yaml --output=public/api-spec-v1.yaml --no-interaction
30+
31+
- name: Check for changes in specification
32+
id: git-diff-spec
33+
continue-on-error: true
34+
run: git diff --diff-filter=ACMRT --exit-code public/api-spec-v1.yaml
35+
36+
- name: Comment PR
37+
if: steps.git-diff-spec.outcome == 'failure'
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
run: |
41+
echo '## 🛑 Exported API specification file not up to date' > var/comment.md
42+
echo '' >> var/comment.md
43+
echo 'Please run `composer update-api-spec` to export the API specification. Then commit and push the changes.' >> var/comment.md
44+
gh pr comment ${{ github.event.pull_request.number }} --body-file var/comment.md --create-if-none --edit-last
45+
46+
- name: Fail job, api spec is not up to date
47+
if: steps.git-diff-spec.outcome == 'failure'
48+
run: |
49+
exit 1
50+
51+
detect-breaking-changes:
52+
name: Detect breaking changes in API specification
53+
runs-on: ubuntu-latest
54+
needs: [api-spec-updated]
55+
steps:
56+
- name: Check out BASE rev
57+
uses: actions/checkout@v5
58+
with:
59+
ref: ${{ github.base_ref }}
60+
path: base
61+
62+
- name: Check out HEAD rev
63+
uses: actions/checkout@v5
64+
with:
65+
ref: ${{ github.head_ref }}
66+
path: head
67+
68+
- name: Run OpenAPI Changed (from HEAD rev)
69+
id: api-changed
70+
continue-on-error: true
71+
uses: docker://openapitools/openapi-diff:latest
72+
with:
73+
args: --fail-on-changed base/public/api-spec-v1.yaml head/public/api-spec-v1.yaml --markdown api-spec-changed.md
74+
75+
- name: Run OpenAPI Incompatible (from HEAD rev)
76+
id: api-incompatible
77+
continue-on-error: true
78+
uses: docker://openapitools/openapi-diff:latest
79+
with:
80+
args: --fail-on-incompatible base/public/api-spec-v1.yaml head/public/api-spec-v1.yaml --markdown api-spec-incompatible.md
81+
82+
- name: Comment PR with no changes
83+
if: steps.api-changed.outcome == 'success' && steps.api-incompatible.outcome == 'success'
84+
working-directory: head
85+
env:
86+
GH_TOKEN: ${{ github.token }}
87+
run: |
88+
gh pr comment ${{ github.event.pull_request.number }} --body "✅ **No changes detected in API specification**" --create-if-none --edit-last
89+
90+
- name: Comment PR with non-breaking changes
91+
if: steps.api-changed.outcome == 'failure' && steps.api-incompatible.outcome == 'success'
92+
working-directory: head
93+
env:
94+
GH_TOKEN: ${{ github.token }}
95+
run: |
96+
echo "## ⚠️ Non-Breaking changes detected in API specification" > ../comment.md
97+
echo "" >> ../comment.md
98+
cat ../api-spec-changed.md >> ../comment.md
99+
gh pr comment ${{ github.event.pull_request.number }} --body-file ../comment.md --create-if-none --edit-last
100+
101+
- name: Comment PR with breaking changes
102+
if: steps.api-incompatible.outcome == 'failure'
103+
working-directory: head
104+
env:
105+
GH_TOKEN: ${{ github.token }}
106+
run: |
107+
echo "## 🛑 Breaking changes detected in API specification" > ../comment.md
108+
echo "" >> ../comment.md
109+
cat ../api-spec-incompatible.md >> ../comment.md
110+
gh pr comment ${{ github.event.pull_request.number }} --body-file ../comment.md --create-if-none --edit-last
111+
112+
- name: Fail if breaking changes detected
113+
if: steps.api-incompatible.outcome == 'failure'
114+
run: |
115+
exit 1

.github/workflows/changelog.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
name: Changelog
1010

1111
on:
12-
pull_request:
12+
pull_request:
1313

1414
jobs:
15-
changelog:
16-
runs-on: ubuntu-latest
17-
strategy:
18-
fail-fast: false
19-
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v5
22-
with:
23-
fetch-depth: 2
15+
changelog:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 2
2424

25-
- name: Git fetch
26-
run: git fetch
25+
- name: Git fetch
26+
run: git fetch
2727

28-
- name: Check that changelog has been updated.
29-
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0
28+
- name: Check that changelog has been updated.
29+
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0

.github/workflows/composer.yaml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,55 +26,55 @@
2626
name: Composer
2727

2828
env:
29-
COMPOSE_USER: root
29+
COMPOSE_USER: root
3030

3131
on:
32-
pull_request:
33-
push:
34-
branches:
35-
- main
36-
- develop
32+
pull_request:
33+
push:
34+
branches:
35+
- main
36+
- develop
3737

3838
jobs:
39-
composer-validate:
40-
runs-on: ubuntu-latest
41-
strategy:
42-
fail-fast: false
43-
steps:
44-
- uses: actions/checkout@v5
39+
composer-validate:
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
steps:
44+
- uses: actions/checkout@v5
4545

46-
- name: Create docker network
47-
run: |
48-
docker network create frontend
46+
- name: Create docker network
47+
run: |
48+
docker network create frontend
4949
50-
- run: |
51-
docker compose run --rm phpfpm composer validate --strict
50+
- run: |
51+
docker compose run --rm phpfpm composer validate --strict
5252
53-
composer-normalized:
54-
runs-on: ubuntu-latest
55-
strategy:
56-
fail-fast: false
57-
steps:
58-
- uses: actions/checkout@v5
53+
composer-normalized:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
steps:
58+
- uses: actions/checkout@v5
5959

60-
- name: Create docker network
61-
run: |
62-
docker network create frontend
60+
- name: Create docker network
61+
run: |
62+
docker network create frontend
6363
64-
- run: |
65-
docker compose run --rm phpfpm composer install
66-
docker compose run --rm phpfpm composer normalize --dry-run
64+
- run: |
65+
docker compose run --rm phpfpm composer install
66+
docker compose run --rm phpfpm composer normalize --dry-run
6767
68-
composer-audit:
69-
runs-on: ubuntu-latest
70-
strategy:
71-
fail-fast: false
72-
steps:
73-
- uses: actions/checkout@v5
68+
composer-audit:
69+
runs-on: ubuntu-latest
70+
strategy:
71+
fail-fast: false
72+
steps:
73+
- uses: actions/checkout@v5
7474

75-
- name: Create docker network
76-
run: |
77-
docker network create frontend
75+
- name: Create docker network
76+
run: |
77+
docker network create frontend
7878
79-
- run: |
80-
docker compose run --rm phpfpm composer audit
79+
- run: |
80+
docker compose run --rm phpfpm composer audit

0 commit comments

Comments
 (0)