Skip to content
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
48 changes: 48 additions & 0 deletions .github/workflows/pull_request_title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Lint PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: write

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: false

- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the [Conventional Commits specification](https://gist.github.com/Zekfad/f51cb06ac76e2457f11c80ed705c95a3#file-conventional-commits-md) and it looks like your proposed title needs to be adjusted.

Details:

```
${{ steps.lint_pr_title.outputs.error_message }}
```

# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ And now you can run goose with this new profile to use the new toolkit!
goose session start --profile demo
```

[developer]: src/goose/toolkit/developer.py
## Conventional Commits

This project follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for PR titles. Conventional Commits make it easier to understand the history of a project and facilitate automation around versioning and changelog generation.

[developer]: src/goose/toolkit/developer.py
[uv]: https://docs.astral.sh/uv/
[ruff]: https://docs.astral.sh/ruff/
[just]: https://github.com/casey/just
Expand Down
2 changes: 1 addition & 1 deletion src/goose/toolkit/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Developer(Toolkit):

def system(self) -> str:
"""Retrieve system configuration details for developer"""
hints_path = Path('.goosehints')
hints_path = Path(".goosehints")
system_prompt = Message.load("prompts/developer.jinja").text
if hints_path.is_file():
goosehints = hints_path.read_text()
Expand Down
2 changes: 0 additions & 2 deletions tests/toolkit/test_developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ def test_write_file(temp_dir, developer_toolkit):
content = "Hello World"
developer_toolkit.write_file(test_file.as_posix(), content)
assert test_file.read_text() == content