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(pr-title): Add commitlint scopes #129

Merged
merged 10 commits into from
Feb 26, 2025
Merged

feat(pr-title): Add commitlint scopes #129

merged 10 commits into from
Feb 26, 2025

Conversation

chris3ware
Copy link
Member

@chris3ware chris3ware commented Feb 13, 2025

Attempting to read the scopes from the commitlint configuration file so they can be used as allowed scopes in the pull request title workflow.

Currently struggling to access the output of the github-action-json-file-properties action and have raised an issue for advice on this.

Using jq to extract scopes.

Resolves #125

@chris3ware
Copy link
Member Author

PR title workflow refactored to use a jq command to extract the scopes from the commitlint configuration file and save to an environment variable. Use the env context to reference the variable. Workflow command will only work in a run step; i.e. when running a shell command.

@chris3ware chris3ware changed the title feat(pr-title): Add commitlint scopes feat(bad-scope): Add commitlint scopes Feb 26, 2025
@chris3ware
Copy link
Member Author

Error message in PR comment for a bad-scope shows the following:

Unknown scope "bad-scope" found in pull request title "feat(bad-scope): Add commitlint scopes". Scope must match one of: checks, commitlint, delete-run, dep-review, get-token, pr-title, ossf, release, renovate, terraform-dir, terraform-docs, trunk, workflows.

This is wonderful stuff.

Testing revealed a nice error message advising which scopes are allowed.
@chris3ware chris3ware changed the title feat(bad-scope): Add commitlint scopes feat(pr-title): Add commitlint scopes Feb 26, 2025
@chris3ware chris3ware marked this pull request as ready for review February 26, 2025 08:22
@chris3ware chris3ware requested a review from a team as a code owner February 26, 2025 08:22
Checks runs on a commit SHA, so if you edit the PR a new run is not
triggered.
@chris3ware chris3ware merged commit 827f302 into main Feb 26, 2025
6 checks passed
@chris3ware chris3ware deleted the feat-commit-scopes branch February 26, 2025 09:16
3ware-release bot pushed a commit that referenced this pull request Feb 26, 2025
## [4.11.0](v4.10.0...v4.11.0) (2025-02-26)

### Features

* **pr-title:** Add commitlint scopes ([#129](#129)) ([827f302](827f302))
@3ware-release
Copy link
Contributor

3ware-release bot commented Feb 26, 2025

This PR is included in version 4.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Required pull request scopes
2 participants