Skip to content

ci: add hacktoberfest-accepted to merged PRs when it was missed - #203

Open
anurag629 wants to merge 1 commit into
developfrom
ci/accepted-label
Open

anurag629 wants to merge 1 commit into
developfrom
ci/accepted-label

Conversation

@anurag629

Copy link
Copy Markdown
Member

A merged PR counts on the leaderboard only when it has hacktoberfest-accepted. Today codercops/chatcops#165 and codercops/chatcops#166 were merged without it, so they didn't count until the label was added by hand.

This workflow runs when a PR is merged and adds the label when:

  • the author isn't a maintainer or a bot, and the PR isn't labeled spam
  • the label isn't there yet
  • every issue the PR closes is assigned to the author (the same rule and the same lookup as the claim check)

Otherwise it leaves a notice on the run and changes nothing. It only runs at the merge, so removing the label afterwards sticks.

It uses pull_request_target so it can label fork PRs, with pull-requests: write and issues: read. It never checks out or runs the PR's code.

How I tested this

I ran the script against merged PRs with the label call replaced by a print. codercops/chatcops#165, #166 and #167, #139 and #181, and codercops/discord-bot#29 would get the label. codercops/ogcops#103 wouldn't, since its issue wasn't assigned to its author, and a PR without a linked issue only gets the notice.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant