Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(GHA): add commitlint and semrel #362

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Lint Commit Messages
on:
push:
branches:
- main
pull_request:

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
31 changes: 0 additions & 31 deletions .github/workflows/monthly-snapshot.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Semantic Releaser
on:
push:
branches:
- main

permissions:
contents: write
packages: write
pull-requests: write

jobs:
semrel:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-case-conflict
- id: check-symlinks
- id: check-json
- id: mixed-line-ending
args: ["--fix=lf"]
- id: no-commit-to-branch
args: [--branch, main]
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
45 changes: 45 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"branches": [
"main",
"master"
],
"ci": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/github",
{
"successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
"labels": false,
"releasedLabels": false
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file."
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
## v2.5.5
- become_user vault_user when modifying files in vault_home

## v2.5.4
## v2.5.4
- New installation instructions

## v2.5.3
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ help: ## list makefile targets

.PHONY: lint
lint: ## lint
ansible-lint -c .ansible-lint
ansible-lint -c .ansible-lint
5 changes: 5 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
ignores: [(message) => /^Bumps \[.+]\(.+\) from .+ to .+\.$/m.test(message)],
}
2 changes: 1 addition & 1 deletion examples/README_VAGRANT.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ If you notice an error like *vm: The '' provisioner could not be found.* make su
7. http://www.vagrantup.com/
8. https://www.virtualbox.org/
9. https://github.com/adrienthebo/vagrant-hosts
10. https://vagrant-libvirt.github.io/vagrant-libvirt
10. https://vagrant-libvirt.github.io/vagrant-libvirt
2 changes: 1 addition & 1 deletion examples/bin/preinstall
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ function add_host {
fi
}

add_host
add_host
1 change: 0 additions & 1 deletion molecule/debian-11-enterprise/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ provisioner:
vault_install_hashi_repo: true
vault_bin_path: /usr/bin
vault_group: vault

11 changes: 5 additions & 6 deletions molecule/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
register: download_goss
until: download_goss is succeeded
retries: 3

- name: Copy Goss tests to remote
template:
src: "{{ item }}"
dest: "{{ goss_test_directory }}/{{ item | basename | splitext | first }}"
mode: 0644
with_fileglob:
- "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/molecule/_tests/test_*.j2"

- name: Register test files
shell: "ls {{ goss_test_directory }}/test_*.yml"
changed_when: false
register: test_files

- name: Execute Goss tests
environment:
# yamllint disable-line rule:line-length
Expand All @@ -50,15 +50,14 @@
changed_when: false
register: test_results
with_items: "{{ test_files.stdout_lines }}"

- name: Display details about the Goss results
debug:
msg: "{{ item.stdout_lines }}"
with_items: "{{ test_results.results }}"

- name: Fail when tests fail
fail:
msg: "Goss failed to validate"
when: item.rc != 0
with_items: "{{ test_results.results }}"

2 changes: 1 addition & 1 deletion role_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ variable. Attempts to download the package from `vault_zip_url` if zip is not fo

Since v2.5.9 of this role you can also install Vault Enterprise via the HashiCorp Repo. In order to install Vault Enterprise via the HashiCorp Repo, set `vault_install_hashi_repo: true*` as well as `vault_enterprise: true`.

**Warning:** Non-Enterprise Package will be removed if already installed and vault_enterprise is set to *true* and vice versa.
**Warning:** Non-Enterprise Package will be removed if already installed and vault_enterprise is set to *true* and vice versa.

# Vault Enterprise with HSM

Expand Down
1 change: 0 additions & 1 deletion templates/vault_backend_dynamodb.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ backend "dynamodb" {
session_token = "{{ vault_dynamodb_session_token }}"
{% endif %}
}

1 change: 0 additions & 1 deletion templates/vault_backend_etcd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ backend "etcd" {
tls_key_file = "{{ vault_backend_tls_private_path }}/{{ vault_backend_tls_key_file }}"
{% endif -%}
}

2 changes: 1 addition & 1 deletion templates/vault_seal_gcpkms.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ seal "gcpckms" {
region = "{{ vault_gkms_region }}"
key_ring = "{{ vault_gkms_key_ring }}"
crypto_key = "{{ vault_gkms_crypto_key }}"
}
}
2 changes: 1 addition & 1 deletion vault_releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ To install a specific version of a package, the version is added to the package
```
$ dnf install vault-enterprise-1.18.2+ent
```
Notice that, different to the Debian package, the trailing `-1` is not required.
Notice that, different to the Debian package, the trailing `-1` is not required.
Loading