From 2db8d7890c525d6aeb80958f4bc2b14d09042be0 Mon Sep 17 00:00:00 2001 From: Ryan Inch Date: Sun, 3 May 2026 23:33:27 -0400 Subject: [PATCH 1/2] Add a roadmap auto commenter for use by all repositories What: adds a workflow that will leave a comment on newly opened issues and pull requests about the roadmap status (i.e. that it isn't on any roadmap yet) of that issue/pull request that can be called by any Hubs Foundation repository. Why: so that people will know what to expect and so that someone doesn't have to manually respond to new issues/pull requests with a stock reply. Also, it's added as a reusable workflow so that changes to the comments or behaviour only have to be made to this workflow, rather than the workflow in every repository. Note: this won't add a comment if it finds a roadmap label has been added to the issue/pull request during creation. --- .../reusable-roadmap-auto-commenter.yml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/reusable-roadmap-auto-commenter.yml diff --git a/.github/workflows/reusable-roadmap-auto-commenter.yml b/.github/workflows/reusable-roadmap-auto-commenter.yml new file mode 100644 index 0000000..d5dcefc --- /dev/null +++ b/.github/workflows/reusable-roadmap-auto-commenter.yml @@ -0,0 +1,50 @@ +name: Reusable Roadmap Auto Commenter +on: + workflow_call + +jobs: + add_issue_comment: + if: ${{ github.event_name == 'issues' && github.repository_owner == 'Hubs-Foundation' }} + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: add initial issue comment + if: "${{ !contains(join(github.event.issue.labels.*.name), 'Roadmap:') }}" + run: | + gh issue comment "$NUMBER" --body "$BODY" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + BODY: | + Thank you for the issue. + + ROADMAP STATUS: This issue isn't currently on any roadmap. Updates will be conveyed here as its place on/off a roadmap changes. + + You can view the roadmaps here: [Roadmaps Google Drive folder](https://drive.google.com/drive/folders/1Z6q2GoqnXIslxfcPP0ctVlTAKLi9OzEt). + + For more information on how the roadmaps work, see our [roadmaps policy on GitHub](https://github.com/Hubs-Foundation/policies-procedures-guidelines-public/blob/main/roadmaps-policy.md). + + add_pull_request_comment: + if: ${{ github.event_name == 'pull_request' && github.repository_owner == 'Hubs-Foundation' }} + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: add initial pull request comment + if: "${{ !contains(join(github.event.pull_request.labels.*.name), 'Roadmap:') }}" + run: | + gh pr comment "$NUMBER" --body "$BODY" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.number }} + BODY: | + Thank you for the pull request. + + ROADMAP STATUS: This pull request isn't currently on any roadmap. Updates will be conveyed here as its place on/off a roadmap changes. + + You can view the roadmaps here: [Roadmaps Google Drive folder](https://drive.google.com/drive/folders/1Z6q2GoqnXIslxfcPP0ctVlTAKLi9OzEt). + + For more information on how the roadmaps work, see our [roadmaps policy on GitHub](https://github.com/Hubs-Foundation/policies-procedures-guidelines-public/blob/main/roadmaps-policy.md). From 29f480f54f08faaef1d7716310f2a70242aac942 Mon Sep 17 00:00:00 2001 From: Ryan Inch Date: Tue, 5 May 2026 04:05:50 -0400 Subject: [PATCH 2/2] Allow the reusable auto commenter to work for external contributors What: modifies the check for pull requests from the `pull_request` event to the `pull_request_target` event and adds a warning comment about it. Why: the `pull_request_target` event bypasses the normal workflow approval rules of the repository and allows the auto commenter to work for pull requests made from external contributors/their forks; it is also safer because it will only run the workflow file from the Hubs Foundation, not the external contributor's pull request (which is why GitHub allows it to run automatically for everyone). --- .github/workflows/reusable-roadmap-auto-commenter.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-roadmap-auto-commenter.yml b/.github/workflows/reusable-roadmap-auto-commenter.yml index d5dcefc..1649177 100644 --- a/.github/workflows/reusable-roadmap-auto-commenter.yml +++ b/.github/workflows/reusable-roadmap-auto-commenter.yml @@ -1,3 +1,5 @@ +# WARNING: This workflow is sometimes triggered by pull_request_target and so will always run automatically on pull requests made by anyone. Do not do any sort of processing of user input, such as checking out code. + name: Reusable Roadmap Auto Commenter on: workflow_call @@ -27,7 +29,7 @@ jobs: For more information on how the roadmaps work, see our [roadmaps policy on GitHub](https://github.com/Hubs-Foundation/policies-procedures-guidelines-public/blob/main/roadmaps-policy.md). add_pull_request_comment: - if: ${{ github.event_name == 'pull_request' && github.repository_owner == 'Hubs-Foundation' }} + if: ${{ github.event_name == 'pull_request_target' && github.repository_owner == 'Hubs-Foundation' }} runs-on: ubuntu-latest permissions: pull-requests: write