Skip to content

Commit a64a5c2

Browse files
authored
Merge pull request #89 from saltstack-formulas/renovate/https-github.com-dafyddj-copier-ssf-ci-2.x
chore(copier): update template https://github.com/dafyddj/copier-ssf-ci to v2.3.0
2 parents 5a83a45 + 2518a94 commit a64a5c2

File tree

7 files changed

+132
-117
lines changed

7 files changed

+132
-117
lines changed

.copier-answers.ssf-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v2.2.1
2+
_commit: v2.3.0
33
_src_path: https://github.com/dafyddj/copier-ssf-ci
44
failure_permitted_ignored: []
55
failure_permitted_patterns: []

.github/workflows/main.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ jobs:
2525
name: Lint / `pre-commit`
2626
needs: should-run
2727
if: fromJSON(needs.should-run.outputs.should-run)
28-
container: techneg/ci-pre-commit:v2.4.26@sha256:60f5e15b35fd93a16bff63a6af078f2e61ca06baf1db18a7b30ebaf121f309ba
28+
container: techneg/ci-pre-commit:v2.4.27@sha256:5d2646b0be8827f1a0880264aa3c49a1fc1e0fe68cdb9cc0f10cca99a808a764
2929
runs-on: ubuntu-latest
3030
timeout-minutes: 5
3131
steps:
32+
- run: | # Needed because of bug #2031 in `actions/checkout`
33+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
3234
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3335
with:
3436
fetch-depth: 0
@@ -41,11 +43,18 @@ jobs:
4143
path: ~/.cache/pre-commit
4244
key: "${{ env.CI_CACHE_ID }}|\
4345
${{ hashFiles('.pre-commit-config.yaml') }}"
46+
restore-keys: |
47+
${{ env.CI_CACHE_ID }}|
48+
- name: Build cache
49+
shell: bash
50+
run: |
51+
pre-commit gc
52+
echo "Installing hook environments"
53+
time pre-commit install-hooks
4454
- name: Run `pre-commit`
4555
run: |
46-
git config --global --add safe.directory $(pwd)
4756
pre-commit run --all-files --color always --verbose
48-
pre-commit run --color always --hook-stage manual commitlint-ci
57+
pre-commit run --color always --hook-stage manual --verbose commitlint-ci
4958
test:
5059
name: Test / Kitchen
5160
needs:

.gitlab-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
stage_test: &stage_test 'test'
1616
# `image`
1717
# yamllint disable rule:line-length
18-
image_commitlint: &image_commitlint 'techneg/ci-commitlint:v1.1.92@sha256:ba54dd413413f05cb3520a1cc160a7f61cc3ec8242914ae3673d3dfa409f0b94'
19-
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.61@sha256:9fa0e0b1c0364a9be92e1f80d3817bc794ed2fe4dc93c8850bab03cd170cbea0'
20-
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.61@sha256:9fa0e0b1c0364a9be92e1f80d3817bc794ed2fe4dc93c8850bab03cd170cbea0'
21-
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.4.26@sha256:60f5e15b35fd93a16bff63a6af078f2e61ca06baf1db18a7b30ebaf121f309ba'
18+
image_commitlint: &image_commitlint 'techneg/ci-commitlint:v1.1.93@sha256:0b34c4b775ca4bcb2c98d1a6dc59d8bf9a435a885ec36af4248d5efb29f5a777'
19+
image_dindruby: &image_dindruby 'techneg/ci-docker-python-ruby:v2.2.62@sha256:c8fb19305e9f2a572d5aecd3031f5d5235349ba43bc362372c4e760b4edcc3de'
20+
image_dindrubybionic: &image_dindrubybionic 'techneg/ci-docker-python-ruby:v2.2.62@sha256:c8fb19305e9f2a572d5aecd3031f5d5235349ba43bc362372c4e760b4edcc3de'
21+
image_precommit: &image_precommit 'techneg/ci-pre-commit:v2.4.27@sha256:5d2646b0be8827f1a0880264aa3c49a1fc1e0fe68cdb9cc0f10cca99a808a764'
2222
image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest@sha256:fe69f9642c7edde46bbd78326d2c42c6e13fc73694efb142e92e206725479328'
2323
image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14@sha256:374f588420087517a3cc0235e11293bffd72d7a59da3d98d5e69f014ff2a7761'
2424
# `services`
2525
services_docker_dind: &services_docker_dind
26-
- 'docker:28.2.2-dind@sha256:ff052514f359111edd920b54581e7aca65629458607f9fbdbf82d7eefbe0602b'
26+
- 'docker:28.2.2-dind@sha256:5fb3f5b69bdab6690d93398a316fdfe906ae4d30667e07994ea5be66483c7b3b'
2727
# yamllint enable rule:line-length
2828
# `variables`
2929
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
- id: commitlint
3131
- id: commitlint-ci
3232
- repo: https://github.com/rubocop-hq/rubocop
33-
rev: v1.76.2
33+
rev: v1.77.0
3434
hooks:
3535
- id: rubocop
3636
name: Check Ruby files with rubocop
@@ -100,16 +100,21 @@ repos:
100100
)$
101101
additional_dependencies: [pygments==2.16.1]
102102
- repo: https://github.com/renovatebot/pre-commit-hooks
103-
rev: 40.59.4
103+
rev: 40.62.1
104104
hooks:
105105
- id: renovate-config-validator
106106
name: Check Renovate config with renovate-config-validator
107107
- repo: https://github.com/python-jsonschema/check-jsonschema
108-
rev: 0.33.0
108+
rev: 0.33.1
109109
hooks:
110110
- id: check-github-workflows
111111
name: Check GitHub workflows with check-jsonschema
112112
args: [--verbose]
113113
- id: check-gitlab-ci
114114
name: Check GitLab CI config with check-jsonschema
115115
args: [--verbose]
116+
- repo: https://github.com/standard/standard
117+
rev: v17.1.2
118+
hooks:
119+
- id: standard
120+
name: Check JavaScript files using standardJS

commitlint.config.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module.exports = {
2-
extends: ['@commitlint/config-conventional'],
3-
rules: {
4-
'body-max-line-length': [2, 'always', 120],
5-
'footer-max-line-length': [2, 'always', 120],
6-
'header-max-length': [2, 'always', 72],
7-
},
8-
ignores: [
9-
(commit) => commit.startsWith("chore(copier):"),
10-
(commit) => commit.startsWith("chore(deps):"),
11-
(commit) => commit.startsWith("ci(pre-commit.ci):"),
12-
(commit) => commit.startsWith("[CI merge]")
13-
],
14-
};
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'body-max-line-length': [2, 'always', 120],
5+
'footer-max-line-length': [2, 'always', 120],
6+
'header-max-length': [2, 'always', 72]
7+
},
8+
ignores: [
9+
(commit) => commit.startsWith('chore(copier):'),
10+
(commit) => commit.startsWith('chore(deps):'),
11+
(commit) => commit.startsWith('ci(pre-commit.ci):'),
12+
(commit) => commit.startsWith('[CI merge]')
13+
]
14+
}

release-rules.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
//
44
// NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
55
module.exports = [
6-
{breaking: true, release: 'major'},
6+
{ breaking: true, release: 'major' },
77
// {type: 'build', release: 'patch'},
88
// {type: 'chore', release: 'patch'},
99
// {type: 'ci', release: 'patch'},
10-
{type: 'docs', release: 'patch'},
11-
{type: 'feat', release: 'minor'},
12-
{type: 'fix', release: 'patch'},
13-
{type: 'perf', release: 'patch'},
14-
{type: 'refactor', release: 'patch'},
15-
{type: 'revert', release: 'patch'},
16-
{type: 'style', release: 'patch'},
17-
{type: 'test', release: 'patch'},
18-
];
10+
{ type: 'docs', release: 'patch' },
11+
{ type: 'feat', release: 'minor' },
12+
{ type: 'fix', release: 'patch' },
13+
{ type: 'perf', release: 'patch' },
14+
{ type: 'refactor', release: 'patch' },
15+
{ type: 'revert', release: 'patch' },
16+
{ type: 'style', release: 'patch' },
17+
{ type: 'test', release: 'patch' }
18+
]

release.config.js

Lines changed: 83 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@ module.exports = {
22
branch: 'master',
33
repositoryUrl: 'https://github.com/saltstack-formulas/vault-formula',
44
plugins: [
5-
['@semantic-release/commit-analyzer', {
6-
preset: 'angular',
7-
releaseRules: './release-rules.js',
8-
}],
9-
'@semantic-release/release-notes-generator',
10-
['@semantic-release/changelog', {
11-
changelogFile: 'CHANGELOG.md',
12-
changelogTitle: '# Changelog',
13-
}],
14-
['@semantic-release/exec', {
15-
prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}',
16-
}],
17-
['@semantic-release/git', {
18-
assets: ['*.md', 'docs/*.rst', 'FORMULA'],
19-
}],
20-
'@semantic-release/github',
5+
['@semantic-release/commit-analyzer', {
6+
preset: 'angular',
7+
releaseRules: './release-rules.js'
8+
}],
9+
'@semantic-release/release-notes-generator',
10+
['@semantic-release/changelog', {
11+
changelogFile: 'CHANGELOG.md',
12+
changelogTitle: '# Changelog'
13+
}],
14+
['@semantic-release/exec', {
15+
// eslint-disable-next-line no-template-curly-in-string
16+
prepareCmd: 'sh ./pre-commit_semantic-release.sh ${nextRelease.version}'
17+
}],
18+
['@semantic-release/git', {
19+
assets: ['*.md', 'docs/*.rst', 'FORMULA']
20+
}],
21+
'@semantic-release/github'
2122
],
2223
generateNotes: {
2324
preset: 'angular',
@@ -26,82 +27,82 @@ module.exports = {
2627
// Bug: https://github.com/conventional-changelog/conventional-changelog/issues/317
2728
// Fix: https://github.com/conventional-changelog/conventional-changelog/pull/410
2829
transform: (commit, context) => {
29-
const issues = []
30+
const issues = []
3031

31-
commit.notes.forEach(note => {
32-
note.title = `BREAKING CHANGES`
33-
})
32+
commit.notes.forEach(note => {
33+
note.title = 'BREAKING CHANGES'
34+
})
3435

35-
// NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
36-
if (commit.type === `feat`) {
37-
commit.type = `Features`
38-
} else if (commit.type === `fix`) {
39-
commit.type = `Bug Fixes`
40-
} else if (commit.type === `perf`) {
41-
commit.type = `Performance Improvements`
42-
} else if (commit.type === `revert`) {
43-
commit.type = `Reverts`
44-
} else if (commit.type === `docs`) {
45-
commit.type = `Documentation`
46-
} else if (commit.type === `style`) {
47-
commit.type = `Styles`
48-
} else if (commit.type === `refactor`) {
49-
commit.type = `Code Refactoring`
50-
} else if (commit.type === `test`) {
51-
commit.type = `Tests`
52-
} else if (commit.type === `build`) {
53-
commit.type = `Build System`
36+
// NOTE: Any changes here must be reflected in `CONTRIBUTING.md`.
37+
if (commit.type === 'feat') {
38+
commit.type = 'Features'
39+
} else if (commit.type === 'fix') {
40+
commit.type = 'Bug Fixes'
41+
} else if (commit.type === 'perf') {
42+
commit.type = 'Performance Improvements'
43+
} else if (commit.type === 'revert') {
44+
commit.type = 'Reverts'
45+
} else if (commit.type === 'docs') {
46+
commit.type = 'Documentation'
47+
} else if (commit.type === 'style') {
48+
commit.type = 'Styles'
49+
} else if (commit.type === 'refactor') {
50+
commit.type = 'Code Refactoring'
51+
} else if (commit.type === 'test') {
52+
commit.type = 'Tests'
53+
} else if (commit.type === 'build') {
54+
commit.type = 'Build System'
5455
// } else if (commit.type === `chore`) {
5556
// commit.type = `Maintenance`
56-
} else if (commit.type === `ci`) {
57-
commit.type = `Continuous Integration`
58-
} else {
59-
return
60-
}
57+
} else if (commit.type === 'ci') {
58+
commit.type = 'Continuous Integration'
59+
} else {
60+
return
61+
}
6162

62-
if (commit.scope === `*`) {
63-
commit.scope = ``
64-
}
63+
if (commit.scope === '*') {
64+
commit.scope = ''
65+
}
6566

66-
if (typeof commit.hash === `string`) {
67-
commit.shortHash = commit.hash.substring(0, 7)
68-
}
67+
if (typeof commit.hash === 'string') {
68+
commit.shortHash = commit.hash.substring(0, 7)
69+
}
6970

70-
if (typeof commit.subject === `string`) {
71-
let url = context.repository
72-
? `${context.host}/${context.owner}/${context.repository}`
73-
: context.repoUrl
74-
if (url) {
75-
url = `${url}/issues/`
76-
// Issue URLs.
77-
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
78-
issues.push(issue)
79-
return `[#${issue}](${url}${issue})`
80-
})
71+
if (typeof commit.subject === 'string') {
72+
let url = context.repository
73+
? `${context.host}/${context.owner}/${context.repository}`
74+
: context.repoUrl
75+
if (url) {
76+
url = `${url}/issues/`
77+
// Issue URLs.
78+
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
79+
issues.push(issue)
80+
return `[#${issue}](${url}${issue})`
81+
})
82+
}
83+
if (context.host) {
84+
// User URLs.
85+
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
86+
if (username.includes('/')) {
87+
return `@${username}`
8188
}
82-
if (context.host) {
83-
// User URLs.
84-
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, username) => {
85-
if (username.includes('/')) {
86-
return `@${username}`
87-
}
8889

89-
return `[@${username}](${context.host}/${username})`
90-
})
91-
}
90+
return `[@${username}](${context.host}/${username})`
91+
})
9292
}
93+
}
9394

94-
// remove references that already appear in the subject
95-
commit.references = commit.references.filter(reference => {
96-
if (issues.indexOf(reference.issue) === -1) {
97-
return true
98-
}
95+
// remove references that already appear in the subject
96+
commit.references = commit.references.filter(reference => {
97+
if (issues.indexOf(reference.issue) === -1) {
98+
return true
99+
}
99100

100-
return false
101-
})
101+
return false
102+
})
102103

103-
return commit
104-
},
105-
},
106-
},
107-
};
104+
return commit
105+
}
106+
}
107+
}
108+
}

0 commit comments

Comments
 (0)