From a5040d26b2e7248c3f440163e40be434b88a710f Mon Sep 17 00:00:00 2001 From: MantisClone Date: Fri, 21 Mar 2025 23:52:45 -0400 Subject: [PATCH] chore: cleanup --- .github/workflows/pr-auto-comments.yml | 6 ++--- README.md | 34 +++----------------------- example-usage.yml | 4 +-- 3 files changed, 8 insertions(+), 36 deletions(-) diff --git a/.github/workflows/pr-auto-comments.yml b/.github/workflows/pr-auto-comments.yml index e521068..5496907 100644 --- a/.github/workflows/pr-auto-comments.yml +++ b/.github/workflows/pr-auto-comments.yml @@ -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, @@ -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, @@ -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, diff --git a/README.md b/README.md index 7a07a78..b6d47b4 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 diff --git a/example-usage.yml b/example-usage.yml index eaad5eb..39f0f8f 100644 --- a/example-usage.yml +++ b/example-usage.yml @@ -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: @@ -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 }}