Skip to content

Commit 56cb5ac

Browse files
authored
fix(ci): Update workflows to use release pipeline (#591)
Signed-off-by: Dan Webb <dan.webb@damacus.io>
1 parent 32cc6c2 commit 56cb5ac

File tree

10 files changed

+77
-170
lines changed

10 files changed

+77
-170
lines changed
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
---
2-
name: 'Validate PR'
2+
name: conventional-commits
33

44
"on":
5-
pull_request_target:
6-
types: [opened, edited, reopened]
5+
pull_request:
6+
types:
7+
- opened
8+
- reopened
9+
- edited
10+
- synchronize
711

812
jobs:
9-
main:
10-
name: Validate PR title
11-
runs-on: ubuntu-latest
12-
permissions:
13-
pull-requests: read
14-
steps:
15-
- uses: amannn/action-semantic-pull-request@v6
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
conventional-commits:
14+
uses: sous-chefs/.github/.github/workflows/conventional-commits.yml@5.0.3
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: 'Copilot Setup Steps'
3+
4+
"on":
5+
workflow_dispatch:
6+
push:
7+
paths:
8+
- .github/workflows/copilot-setup-steps.yml
9+
pull_request:
10+
paths:
11+
- .github/workflows/copilot-setup-steps.yml
12+
13+
jobs:
14+
copilot-setup-steps:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v5
21+
- name: Install Chef
22+
uses: actionshub/chef-install@main
23+
- name: Install cookbooks
24+
run: berks install
Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
11
---
2-
name: Prevent file change
2+
name: prevent-file-change
33

44
"on":
5-
pull_request_target:
6-
branches: [main]
5+
pull_request:
6+
types:
7+
- opened
8+
- reopened
9+
- edited
10+
- synchronize
711

812
jobs:
9-
prevent-metadata-change:
10-
runs-on: ubuntu-latest
11-
permissions:
12-
pull-requests: write
13-
steps:
14-
- name: Prevent metadata.rb file change
15-
uses: xalvarez/prevent-file-change-action@v2
16-
with:
17-
githubToken: ${{ secrets.GITHUB_TOKEN }}
18-
pattern: metadata.rb
19-
trustedAuthors: &maintainers bmhughes,damacus,kitchen-porter,MarkGibbons,ramereth,Stromweld,xorima
20-
21-
prevent-workflow-change:
22-
runs-on: ubuntu-latest
23-
permissions:
24-
pull-requests: write
25-
steps:
26-
- name: Prevent workflow file change
27-
uses: xalvarez/prevent-file-change-action@v2
28-
with:
29-
githubToken: ${{ secrets.GITHUB_TOKEN }}
30-
pattern: .github/workflows
31-
trustedAuthors: *maintainers
32-
closePR: true
33-
allowNewFiles: false
13+
prevent-file-change:
14+
uses: sous-chefs/.github/.github/workflows/prevent-file-change.yml@5.0.3
15+
secrets:
16+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 9 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
name: release-please
2+
name: release
33

44
"on":
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78

89
permissions:
910
contents: write
@@ -14,68 +15,9 @@ permissions:
1415
id-token: write
1516

1617
jobs:
17-
release-please:
18-
runs-on: ubuntu-latest
19-
outputs:
20-
release_created: ${{ steps.release.outputs.release_created }}
21-
tag_name: ${{ steps.release.outputs.tag_name }}
22-
upload_url: ${{ steps.release.outputs.upload_url }}
23-
steps:
24-
- uses: googleapis/release-please-action@v4
25-
id: release
26-
with:
27-
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
28-
29-
- name: Checkout
30-
uses: actions/checkout@v5
31-
if: ${{ steps.release.outputs.release_created }}
32-
33-
- name: Upload cookbook as artifact
34-
if: ${{ steps.release.outputs.release_created }}
35-
id: upload
36-
uses: actions/upload-artifact@v4
37-
with:
38-
name: haproxy-cookbook-${{ steps.release.outputs.tag_name }}
39-
path: |
40-
.
41-
!.git/
42-
!.github/
43-
!.kitchen/
44-
!.vscode/
45-
!documentation/
46-
!.gitignore
47-
!test/
48-
!spec/
49-
retention-days: 90
50-
compression-level: 6
51-
52-
- name: Generate artifact attestation
53-
if: ${{ steps.release.outputs.release_created }}
54-
uses: actions/attest-build-provenance@v3
55-
with:
56-
subject-name: haproxy-cookbook-${{ steps.release.outputs.tag_name }}
57-
subject-digest: sha256:${{ steps.upload.outputs.artifact-digest }}
58-
59-
publish-to-supermarket:
60-
needs: release-please
61-
if: ${{ needs.release-please.outputs.release_created }}
62-
runs-on: ubuntu-latest
63-
container:
64-
image: chef/chefworkstation:latest
65-
steps:
66-
- name: Checkout
67-
uses: actions/checkout@v5
68-
69-
- name: Configure Chef credentials
70-
run: |
71-
mkdir -p ~/.chef
72-
echo "${{ secrets.CHEF_SUPERMARKET_KEY }}" > ~/.chef/supermarket.pem
73-
chmod 600 ~/.chef/supermarket.pem
74-
75-
- name: Publish to Chef Supermarket
76-
run: |
77-
knife supermarket share haproxy \
78-
--supermarket-site https://supermarket.chef.io \
79-
--key ~/.chef/supermarket.pem \
80-
--user ${{ secrets.CHEF_SUPERMARKET_USER }} \
81-
--cookbook-path ../
18+
release:
19+
uses: sous-chefs/.github/.github/workflows/release-cookbook.yml@5.0.3
20+
secrets:
21+
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
22+
supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}
23+
supermarket_key: ${{ secrets.CHEF_SUPERMARKET_KEY }}

.markdownlint-cli2.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ config:
33
line-length: false # MD013
44
no-duplicate-heading: false # MD024
55
reference-links-images: false # MD052
6-
no-multiple-blanks: false # MD012 Ignore due to release-please
6+
no-multiple-blanks:
7+
maximum: 2
78
ignores:
89
- .github/copilot-instructions.md

CHANGELOG.md

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,58 @@ This file is used to list changes made in each version of the haproxy cookbook.
44

55
## [12.4.11](https://github.com/sous-chefs/haproxy/compare/v12.4.10...v12.4.11) (2025-09-15)
66

7-
87
### Bug Fixes
98

10-
* **ci:** Fix share command ([#556](https://github.com/sous-chefs/haproxy/issues/556)) ([f63a220](https://github.com/sous-chefs/haproxy/commit/f63a220b586cd8d6c54f9401f4b42769d2a0239c))
9+
**ci:** Fix share command ([#556](https://github.com/sous-chefs/haproxy/issues/556)) ([f63a220](https://github.com/sous-chefs/haproxy/commit/f63a220b586cd8d6c54f9401f4b42769d2a0239c))
1110

1211
## [12.4.10](https://github.com/sous-chefs/haproxy/compare/v12.4.9...v12.4.10) (2025-09-15)
1312

14-
1513
### Bug Fixes
1614

17-
* **tests:** Add unit test coverage for haproxy_listen option parameter (already implemented) ([#550](https://github.com/sous-chefs/haproxy/issues/550)) ([2be5b18](https://github.com/sous-chefs/haproxy/commit/2be5b18e52fc64949b5ea3824dfd79528b44af70))
15+
**tests:** Add unit test coverage for haproxy_listen option parameter (already implemented) ([#550](https://github.com/sous-chefs/haproxy/issues/550)) ([2be5b18](https://github.com/sous-chefs/haproxy/commit/2be5b18e52fc64949b5ea3824dfd79528b44af70))
1816

1917
## [12.4.9](https://github.com/sous-chefs/haproxy/compare/v12.4.8...v12.4.9) (2025-09-12)
2018

21-
2219
### Bug Fixes
2320

2421
* output reference in workflow ([#552](https://github.com/sous-chefs/haproxy/issues/552)) ([3711253](https://github.com/sous-chefs/haproxy/commit/3711253ace28ae7b979aeb9cebbab3d5e2aa5e96))
2522

2623
## [12.4.8](https://github.com/sous-chefs/haproxy/compare/v12.4.7...v12.4.8) (2025-09-11)
2724

28-
2925
### Bug Fixes
3026

3127
* Missing slash in release.yml ([#548](https://github.com/sous-chefs/haproxy/issues/548)) ([b212876](https://github.com/sous-chefs/haproxy/commit/b212876afe9d633ac826895daba950f029246c16))
3228

3329
## [12.4.7](https://github.com/sous-chefs/haproxy/compare/v12.4.6...v12.4.7) (2025-09-11)
3430

35-
3631
### Bug Fixes
3732

3833
* fix pathing ([bb5a070](https://github.com/sous-chefs/haproxy/commit/bb5a0707fa9892829c15e3a596de1332d6ff6b1a))
3934

4035
## [12.4.6](https://github.com/sous-chefs/haproxy/compare/v12.4.5...v12.4.6) (2025-09-11)
4136

42-
4337
### Bug Fixes
4438

45-
* **ci:** Fix supermarket share command typo ([cea808c](https://github.com/sous-chefs/haproxy/commit/cea808c6216d54745fe852aaa49e6b8efe0e6a12))
39+
**ci:** Fix supermarket share command typo ([cea808c](https://github.com/sous-chefs/haproxy/commit/cea808c6216d54745fe852aaa49e6b8efe0e6a12))
4640

4741
## [12.4.5](https://github.com/sous-chefs/haproxy/compare/v12.4.4...v12.4.5) (2025-09-11)
4842

49-
5043
### Bug Fixes
5144

52-
* **ci:** More CI fixes ([#544](https://github.com/sous-chefs/haproxy/issues/544)) ([88a9ca0](https://github.com/sous-chefs/haproxy/commit/88a9ca00a24318ecbd2426fc3cc4e0ac0268762f))
45+
**ci:** More CI fixes ([#544](https://github.com/sous-chefs/haproxy/issues/544)) ([88a9ca0](https://github.com/sous-chefs/haproxy/commit/88a9ca00a24318ecbd2426fc3cc4e0ac0268762f))
5346

5447
## [12.4.4](https://github.com/sous-chefs/haproxy/compare/v12.4.3...v12.4.4) (2025-09-11)
5548

56-
5749
### Bug Fixes
5850

59-
* **ci:** Fix attestation ([#541](https://github.com/sous-chefs/haproxy/issues/541)) ([5c92cbd](https://github.com/sous-chefs/haproxy/commit/5c92cbdfd984f300957dc4aa0014408505ef1915))
51+
**ci:** Fix attestation ([#541](https://github.com/sous-chefs/haproxy/issues/541)) ([5c92cbd](https://github.com/sous-chefs/haproxy/commit/5c92cbdfd984f300957dc4aa0014408505ef1915))
6052

6153
## [12.4.3](https://github.com/sous-chefs/haproxy/compare/v12.4.2...v12.4.3) (2025-09-11)
6254

63-
6455
### Bug Fixes
6556

6657
* .release-please-manifest.json ([#523](https://github.com/sous-chefs/haproxy/issues/523)) ([bf9797d](https://github.com/sous-chefs/haproxy/commit/bf9797db291e794c150a9e713064c4e8f3062f03))
67-
* **ai:** Add GitHub Copilot instructions ([#536](https://github.com/sous-chefs/haproxy/issues/536)) ([4836686](https://github.com/sous-chefs/haproxy/commit/4836686016b10f1be5423661d65191977b6d77ed))
58+
**ai:** Add GitHub Copilot instructions ([#536](https://github.com/sous-chefs/haproxy/issues/536)) ([4836686](https://github.com/sous-chefs/haproxy/commit/4836686016b10f1be5423661d65191977b6d77ed))
6859
* Fix tested platforms & Add publishing support ([#519](https://github.com/sous-chefs/haproxy/issues/519)) ([ff3daaa](https://github.com/sous-chefs/haproxy/commit/ff3daaa37d08f7757fe28d78dcd76c44edeeb083))
6960
* release please manifest ([#524](https://github.com/sous-chefs/haproxy/issues/524)) ([e4421fd](https://github.com/sous-chefs/haproxy/commit/e4421fd31d1c27ed1134017847c5991839edb2db))
7061
* Remove EOL HAProxy 2.9 & update workflows ([#531](https://github.com/sous-chefs/haproxy/issues/531)) ([5ffa69f](https://github.com/sous-chefs/haproxy/commit/5ffa69fca2b418bb9cdd6c3482d9f76d78b22f99))
@@ -73,7 +64,6 @@ This file is used to list changes made in each version of the haproxy cookbook.
7364

7465
## [12.4.2](https://github.com/sous-chefs/haproxy/compare/12.4.1...v12.4.2) (2025-09-10)
7566

76-
7767
### Bug Fixes
7868

7969
* .release-please-manifest.json ([#523](https://github.com/sous-chefs/haproxy/issues/523)) ([bf9797d](https://github.com/sous-chefs/haproxy/commit/bf9797db291e794c150a9e713064c4e8f3062f03))
@@ -83,8 +73,6 @@ This file is used to list changes made in each version of the haproxy cookbook.
8373
* Revert to simple release-please config to prevent Node.js auto-detection ([e1f3324](https://github.com/sous-chefs/haproxy/commit/e1f3324ca4534d84377d10492e9466e8c065d477))
8474
* With conventional commits we do not require labels ([#527](https://github.com/sous-chefs/haproxy/issues/527)) ([a02cf07](https://github.com/sous-chefs/haproxy/commit/a02cf07dff74e6499bed044e11abe6589b017c8a))
8575

86-
## 12.4.1 - *2025-09-04*
87-
8876
## 12.4.0 - *2024-12-09*
8977

9078
* Add `option` property to `haproxy_listen`
@@ -94,20 +82,10 @@ This file is used to list changes made in each version of the haproxy cookbook.
9482

9583
Standardise files with files in sous-chefs/repo-management
9684

97-
## 12.3.6 - *2024-11-05*
98-
9985
## 12.3.5 - *2024-07-15*
10086

10187
Standardise files with files in sous-chefs/repo-management
10288

103-
## 12.3.4 - *2024-05-03*
104-
105-
## 12.3.3 - *2024-05-03*
106-
107-
## 12.3.2 - *2024-02-01*
108-
109-
## 12.3.1 - *2024-02-01*
110-
11189
## 12.3.0 - *2024-01-31*
11290

11391
* Update default HAProxy source install verision to 2.8.5
@@ -123,28 +101,10 @@ Standardise files with files in sous-chefs/repo-management
123101
* Fix source lua tests on CentOS & Fedora
124102
* Remove OpenSSL tests, as this is out of scope of the core cookbook currently
125103

126-
## 12.2.24 - *2024-01-31*
127-
128-
## 12.2.23 - *2023-10-26*
129-
130-
## 12.2.22 - *2023-09-28*
131-
132-
## 12.2.21 - *2023-09-04*
133-
134-
## 12.2.20 - *2023-08-30*
135-
136-
## 12.2.19 - *2023-05-17*
137-
138-
## 12.2.18 - *2023-04-17*
139-
140104
## 12.2.17 - *2023-04-07*
141105

142106
Standardise files with files in sous-chefs/repo-management
143107

144-
## 12.2.16 - *2023-04-01*
145-
146-
## 12.2.15 - *2023-04-01*
147-
148108
## 12.2.14 - *2023-04-01*
149109

150110
Standardise files with files in sous-chefs/repo-management

resources/frontend.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
description: 'Set the running mode or protocol of the instance'
1111

1212
property :maxconn, [Integer, String],
13-
coerce: proc { |p| p.to_s },
13+
coerce: proc(&:to_s),
1414
description: 'Sets the maximum per-process number of concurrent connections'
1515

1616
property :default_backend, String,

resources/service.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def do_service_action(resource_action)
4747
declare_resource(:service, new_resource.service_name).delayed_action(resource_action)
4848
rescue Mixlib::ShellOut::ShellCommandFailed
4949
if new_resource.config_test_fail_action.eql?(:log)
50-
Chef::Log.error("Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n"\
50+
Chef::Log.error("Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n" \
5151
"Error\n-----\n#{cmd.stderr}")
5252
else
53-
raise "Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n"\
53+
raise "Configuration test failed, #{new_resource.service_name} #{resource_action} action aborted!\n\n" \
5454
"Error\n-----\nAction: #{resource_action}\n#{cmd.stderr}"
5555
end
5656
end

test/cookbooks/test/recipes/source_lua.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
# extract lua
3535
execute 'lua extract' do
3636
command 'tar xf lua-5.3.1.tar.gz'
37-
cwd "#{Chef::Config[:file_cache_path]}"
37+
cwd Chef::Config[:file_cache_path].to_s
3838
not_if { ::File.exist?('/opt/lua-5.3.1/bin/lua') }
3939
end
4040

test/integration/config_3/controls/config_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@
6262
'',
6363
'',
6464
'listen admin',
65-
' mode http',
66-
' bind 0.0.0.0:1337',
67-
' stats uri /',
68-
' stats realm Haproxy-Statistics',
69-
' stats auth user:pwd',
70-
' http-request add-header X-Forwarded-Proto https if { ssl_fc }',
71-
' http-request add-header X-Proto http',
72-
' http-response set-header Expires %\[date\(3600\),http_date\]',
73-
' default_backend servers',
74-
' option dontlog-normal',
75-
' bind-process odd',
76-
' hash-type consistent',
65+
' mode http',
66+
' bind 0.0.0.0:1337',
67+
' stats uri /',
68+
' stats realm Haproxy-Statistics',
69+
' stats auth user:pwd',
70+
' http-request add-header X-Forwarded-Proto https if { ssl_fc }',
71+
' http-request add-header X-Proto http',
72+
' http-response set-header Expires %\[date\(3600\),http_date\]',
73+
' default_backend servers',
74+
' option dontlog-normal',
75+
' bind-process odd',
76+
' hash-type consistent',
7777
]
7878

7979
describe file('/etc/haproxy/haproxy.cfg') do

0 commit comments

Comments
 (0)