fix(actions): remove the welcome action (#46766)

This commit is contained in:
Mrugesh Mohapatra
2022-07-05 23:17:37 +05:30
committed by GitHub
parent 37c886e9db
commit c505a02165
-49
View File
@@ -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!
`
});