From 8b73ca0e36c925f0365925af16decd016a7d51e2 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 26 Nov 2024 07:48:56 +0100 Subject: [PATCH] Add comment for cross-track maintainers for unmaintained repos (#196) --- .../ping-cross-track-maintainers-team.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/ping-cross-track-maintainers-team.yml b/.github/workflows/ping-cross-track-maintainers-team.yml index 10ee8af..f3ae749 100644 --- a/.github/workflows/ping-cross-track-maintainers-team.yml +++ b/.github/workflows/ping-cross-track-maintainers-team.yml @@ -41,6 +41,19 @@ jobs: return response.data.names.includes('exercism-tooling'); + - name: Check if repo is unmaintained repo + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + if: steps.repo-requires-ping.outputs.result == 'true' + id: is-unmaintained-repo + with: + script: | + const response = await github.rest.repos.getAllTopics({ + owner: context.repo.owner, + repo: context.repo.repo, + }); + + return response.data.names.includes('unmaintained'); + - name: Check if PR author is member of cross-track-maintainers team uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea if: steps.repo-requires-ping.outputs.result == 'true' && steps.is-tooling-repo.outputs.result == 'false' @@ -91,6 +104,18 @@ jobs: body: `Hello 👋 Thanks for your PR.\n\nThis repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed.\n\nIf you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track.\n\nPlease feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the [Exercism forum](https://exercism.org/r/forum).\n\n_(cc @exercism/cross-track-maintainers)_` }) + - name: Create cross-track-maintainers team unmaintained repo comment + if: steps.repo-requires-ping.outputs.result == 'true' && steps.is-tooling-repo.outputs.result == 'false' && steps.is-unmaintained-repo.outputs.result == 'true' && steps.author-is-member-cross-track-maintainers-team.outputs.result == 'false' + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `This is an unmaintained repository.\n\nCross-track maintainers - feel free to merge.` + }) + - name: Create guardians team ping comment if: steps.repo-requires-ping.outputs.result == 'true' && steps.is-tooling-repo.outputs.result == 'true' && steps.author-is-member-guardians-team.outputs.result == 'false' uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea