Skip to content

chore: cleanup #7

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

Merged
merged 1 commit into from
Mar 22, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/pr-auto-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
- name: Leave first PR comment
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.token || github.token }}
script: |
const variables = {
username: context.payload.pull_request.user.login,
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- name: Leave ready for review comment
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.token || github.token }}
script: |
const variables = {
username: context.payload.pull_request.user.login,
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
- name: Leave merged PR comment
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.token || github.token }}
script: |
const variables = {
username: context.payload.pull_request.user.login,
Expand Down
34 changes: 3 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,6 @@ This workflow uses a reference to the branch (`@main`) rather than a specific ve
- **Automatic Updates**: When the workflow code is updated in the `main` branch, all repositories referencing it will automatically use the latest version without requiring any changes in those repositories.
- **Breaking Changes**: Be cautious when making changes to the workflow in the `main` branch, as they will immediately affect all dependent repositories. Test significant changes thoroughly before merging them into `main`.

### Recommendations for Stability

If you need more stability and control over updates, consider:
1. Using version tags (e.g., `@v1`, `@v2`) instead of `@main`.
2. Having repositories explicitly opt-in to new versions by updating their workflow reference.

For example, to use a specific version tag:
```yaml
uses: your-org/auto-comments/.github/workflows/pr-auto-comments.yml@v1
```

## Configuration

### Required Inputs
Expand All @@ -138,20 +127,7 @@ uses: your-org/auto-comments/.github/workflows/pr-auto-comments.yml@v1

| Secret | Description | Required | Default |
|--------|-------------|----------|---------|
| `token` | GitHub token with org:read permission | No | `github.token` |

## Default Messages

The workflow includes default messages for each comment type:

### First PR Comment
A welcome message that mentions the contributor by username, introduces them to the project, and highlights the Best PR Initiative with its $500 quarterly prize.

### Ready for Review Comment
A reminder about contribution guidelines and the Best PR Initiative, encouraging clear PR descriptions to expedite the review process.

### Merged PR Comment
A congratulatory message that thanks the contributor, reminds them about the Best PR Initiative, and promotes the Request Network API for crypto payments and invoicing features.
| `token` | GitHub token with necessary permissions (see above) | No | `github.token` |

## Enabling and Disabling Comment Types

Expand Down Expand Up @@ -223,13 +199,9 @@ The workflow requires a token with `org:read` permission to check organization m

## Integration Testing

For integration testing purposes, we maintain a separate [auto-comments-test](https://github.com/RequestNetwork/auto-comments-test) repository. This repository contains workflows that:

1. Test actual PR events using the reusable workflow
2. Allow manual simulation of different PR events
3. Support testing different branches or versions of the workflow
For integration testing purposes, we maintain a separate [auto-comments-test](https://github.com/RequestNetwork/auto-comments-test) repository. This repository provides a real-world environment for testing the workflow.

If you're developing changes to this workflow, you can test them using the integration test repository before merging to the main branch.
If you're developing changes to this workflow, you should test them using the integration test repository before merging to the main branch.

## License

Expand Down
4 changes: 2 additions & 2 deletions example-usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
additional_internal_users: "external-consultant,bot-account"
# No comment content provided - will use defaults
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GH_PAT }}

# Example 2: Customizing some comments, disabling others
pr-comments-custom:
Expand All @@ -38,4 +38,4 @@ jobs:
Thank you @{{username}} for your contribution to {{repository}}!
Your changes are now part of the {{org}} codebase.
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GH_PAT }}