mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-24 12:13:31 +08:00
fix(actions): remove the welcome action (#46766)
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
name: Github - Welcome First-timers
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
|
||||
jobs:
|
||||
welcome:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Welcome New Contributors
|
||||
if: github.event.pull_request.merged == true
|
||||
uses: actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # tag=v6
|
||||
with:
|
||||
github-token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
||||
script: |
|
||||
const pull = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number
|
||||
});
|
||||
const creator = pull.data.user.login;
|
||||
const excludedCreators = ["renovate[bot]", "camperbot", "github-actions[bot]"];
|
||||
if (excludedCreators.includes(creator)) {
|
||||
return;
|
||||
}
|
||||
const repo = `${context.repo.owner}/${context.repo.repo}`;
|
||||
const pulls = await github.rest.search.issuesAndPullRequests({
|
||||
q: `repo:${repo}+author:${creator}+is:pr+is:merged`
|
||||
});
|
||||
// This means they've got merged PRs.
|
||||
if (pulls?.data?.total_count > 1) {
|
||||
return;
|
||||
}
|
||||
github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `
|
||||
#### :sparkles: :tada: **AWESOME!** :tada: :sparkles:
|
||||
|
||||
Hi @${creator},
|
||||
|
||||
Thanks for this pull request and for contributing to the code-base for the first time. We are looking forward to more contributions from you in the future.
|
||||
|
||||
Cheers & happy contributing!
|
||||
`
|
||||
});
|
||||
Reference in New Issue
Block a user