Files
freeCodeCamp/.github/workflows/github-spam.yml
renovate[bot] a7295b38e0 chore(deps): update github actions to 93ea575 (#48062)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-15 12:55:48 +00:00

24 lines
1.0 KiB
YAML

name: GitHub - Spam PR
on:
pull_request_target:
types:
- labeled
jobs:
is-spam:
runs-on: ubuntu-20.04
steps:
- uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # tag=v6
with:
github-token: ${{secrets.CAMPERBOT_NO_TRANSLATE}}
script: |
const isSpam = context.payload.pull_request.labels.find(label => label.name === "spam");
if (isSpam) {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "We are marking this pull request as spam. Please note that if you are participating in Hacktoberfest, two or more PRs marked as spam will result in your permanent disqualification.\n\nIf you are interested in making quality and genuine contributions to our projects, check out our [contributing guidelines](https://contribute.freecodecamp.org)."
})
}