Skip to content

Commit 8b73ca0

Browse files
Add comment for cross-track maintainers for unmaintained repos (exercism#196)
1 parent 20a502d commit 8b73ca0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/ping-cross-track-maintainers-team.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ jobs:
4141
4242
return response.data.names.includes('exercism-tooling');
4343
44+
- name: Check if repo is unmaintained repo
45+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
46+
if: steps.repo-requires-ping.outputs.result == 'true'
47+
id: is-unmaintained-repo
48+
with:
49+
script: |
50+
const response = await github.rest.repos.getAllTopics({
51+
owner: context.repo.owner,
52+
repo: context.repo.repo,
53+
});
54+
55+
return response.data.names.includes('unmaintained');
56+
4457
- name: Check if PR author is member of cross-track-maintainers team
4558
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
4659
if: steps.repo-requires-ping.outputs.result == 'true' && steps.is-tooling-repo.outputs.result == 'false'
@@ -91,6 +104,18 @@ jobs:
91104
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)_`
92105
})
93106
107+
- name: Create cross-track-maintainers team unmaintained repo comment
108+
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'
109+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
110+
with:
111+
script: |
112+
github.rest.issues.createComment({
113+
issue_number: context.issue.number,
114+
owner: context.repo.owner,
115+
repo: context.repo.repo,
116+
body: `This is an unmaintained repository.\n\nCross-track maintainers - feel free to merge.`
117+
})
118+
94119
- name: Create guardians team ping comment
95120
if: steps.repo-requires-ping.outputs.result == 'true' && steps.is-tooling-repo.outputs.result == 'true' && steps.author-is-member-guardians-team.outputs.result == 'false'
96121
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea

0 commit comments

Comments
 (0)