diff --git a/.github/workflows/auto-handle-on-label.yml b/.github/workflows/auto-handle-on-label.yml index d142a9b3a..bbc753521 100644 --- a/.github/workflows/auto-handle-on-label.yml +++ b/.github/workflows/auto-handle-on-label.yml @@ -1,6 +1,8 @@ name: Auto-comment and handle PRs and issues on label env: CONTRIBUTING_LINK: https://github.com/n8n-io/n8n-docs/blob/main/CONTRIBUTING.md + ORG_NAME: n8n-io + AUTHOR: ${{ github.event.issue.user.login || github.event.pull_request.user.login }} on: issues: types: @@ -10,7 +12,7 @@ on: - labeled jobs: handle-labels: - if: contains(fromJSON('["spam", "ai-slop", "low-effort-bad", "duplicate", "dev-cancelled", "pending-dev", "in-next-release", "old-course"]'), github.event.label.name) + if: contains(fromJSON('["block", "spam", "ai-slop", "low-effort-unusable", "low-effort-usable", "duplicate", "dev-cancelled", "old-course", "pending-dev", "in-next-release" ]'), github.event.label.name) runs-on: ubuntu-latest permissions: issues: write @@ -19,34 +21,85 @@ jobs: - name: Set label config id: config run: | - AUTHOR="${{ github.event.issue.user.login || github.event.pull_request.user.login }}" case "${{ github.event.label.name }}" in - "spam") - echo "comment=@$AUTHOR This appears to be spam. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT + "block") + echo "comment=@${{ env.AUTHOR }} Due to a violation of our contributing guidelines, you are now blocked. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT echo "should_close=true" >> $GITHUB_OUTPUT + curl -L \ + -X PUT \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GH_ORG_BLOCK_USER_PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/orgs/${{ env.ORG_NAME }}/blocks/${{ env.AUTHOR }}" + ;; + "spam") + echo "comment=@${{ env.AUTHOR }} This appears to be spam. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT + echo "should_close=true" >> $GITHUB_OUTPUT + curl -L \ + -X PUT \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GH_ORG_BLOCK_USER_PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/orgs/${{ env.ORG_NAME }}/blocks/${{ env.AUTHOR }}" ;; "ai-slop") - echo "comment=@$AUTHOR This appears to be AI generated, and has quality or accuracy problems. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT + echo "comment=@${{ env.AUTHOR }} This appears to be AI generated, and has quality or accuracy problems. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT echo "should_close=true" >> $GITHUB_OUTPUT + curl -L \ + -X PUT \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GH_ORG_BLOCK_USER_PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/orgs/${{ env.ORG_NAME }}/blocks/${{ env.AUTHOR }}" ;; - "low-effort-bad") - echo "comment=@$AUTHOR This is a minor contribution with quality problems. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT - echo "should_close=true" >> $GITHUB_OUTPUT + "low-effort-unusable") + response=$(curl -s -X POST \ + -u "${{ secrets.WEBHOOK_USER}}:${{ secrets.WEBHOOK_PASSWORD }}" \ + -H "Content-Type: application/json" \ + -d "$(printf '{"user": %s, "label": "low-effort-unusable"}' "$(printf '%s' "${{ env.AUTHOR }}" | jq -Rs .)")" \ + "${{ secrets.WEBHOOK_URL}}") + if [ "$response" = "true" ]; then + echo "comment=@${{ env.AUTHOR }} Thank you for contributing. This is a minor contribution with quality or accuracy problems. Due to multiple low-effort-unusable contributions, you are now blocked. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines to understand more." >> $GITHUB_OUTPUT + echo "should_close=true" >> $GITHUB_OUTPUT + curl -L \ + -X PUT \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.GH_ORG_BLOCK_USER_PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/orgs/${{ env.ORG_NAME }}/blocks/${{ env.AUTHOR }}" + elif [ "$response" = "false" ]; then + echo "comment=@${{ env.AUTHOR }} This is a minor contribution with quality or accuracy problems. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT + echo "should_close=true" >> $GITHUB_OUTPUT + fi + ;; + "low-effort-usable") + curl -s -X POST \ + -u "${{ secrets.WEBHOOK_USER}}:${{ secrets.WEBHOOK_PASSWORD }}" \ + -H "Content-Type: application/json" \ + -d "$(printf '{"user": %s, "label": "low-effort-usable"}' "$(printf '%s' "${{ env.AUTHOR }}" | jq -Rs .)")" \ + "${{ secrets.WEBHOOK_URL}}" + echo "comment=@${{ env.AUTHOR }} Thank you for contributing. This is a minor contribution, but good quality. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines, and keep low-effort contributions to a minimum." >> $GITHUB_OUTPUT + echo "should_close=false" >> $GITHUB_OUTPUT ;; "duplicate") - echo "comment=@$AUTHOR This duplicates another issue or PR, or the work was already done elsewhere. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT + echo "comment=@${{ env.AUTHOR }} This duplicates another issue or PR, or the work was already done elsewhere. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT echo "should_close=true" >> $GITHUB_OUTPUT ;; "old-course") - echo "comment=Hi @$AUTHOR! Thanks for your contribution, but we are no longer updating the course. We expect to fully replace it in the coming months. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT + curl -s -X POST \ + -u "${{ secrets.WEBHOOK_USER}}:${{ secrets.WEBHOOK_PASSWORD }}" \ + -H "Content-Type: application/json" \ + -d "$(printf '{"user": %s, "label": "old-course"}' "$(printf '%s' "${{ env.AUTHOR }}" | jq -Rs .)")" \ + "${{ secrets.WEBHOOK_URL}}" + echo "comment=Hi @${{ env.AUTHOR }}! Thanks for your contribution, but we are no longer updating the course. We expect to fully replace it in the coming months. Please review n8n's [contributing](${{ env.CONTRIBUTING_LINK }}) guidelines." >> $GITHUB_OUTPUT echo "should_close=true" >> $GITHUB_OUTPUT ;; "dev-cancelled") - echo "comment=Hi @$AUTHOR, thanks for the pull request! It looks like the PR in the main repo was closed. I'm going to go ahead and close this one too since this depends on the main repo submission being accepted. Please let me know if the status changes, however, and we can re-open as needed." >> $GITHUB_OUTPUT + echo "comment=Hi @${{ env.AUTHOR }}, thanks for the pull request! It looks like the PR in the main repo was closed. I'm going to go ahead and close this one too since this depends on the main repo submission being accepted. Please let me know if the status changes, however, and we can re-open as needed." >> $GITHUB_OUTPUT echo "should_close=true" >> $GITHUB_OUTPUT ;; "pending-dev") - echo "comment=Thanks @$AUTHOR! We'll hold off on reviewing this until the PR is ready to go in the main repo." >> $GITHUB_OUTPUT + echo "comment=Thanks @${{ env.AUTHOR }}! We'll hold off on reviewing this until the PR is ready to go in the main repo." >> $GITHUB_OUTPUT echo "should_close=false" >> $GITHUB_OUTPUT ;; "in-next-release") @@ -72,4 +125,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} - NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} + NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f95cb32c2..510f14ca0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,6 @@ If you want to contribute to this repository - thank you! Before you start, have a look at the existing documentation to get an idea of the structure and writing conventions n8n uses. In writing your documentation, please follow the guidelines described below, to ensure quality and consistency with n8n styles. -## No course contributions - -We are working on replacing the course. We are not accepting reports or changes to the current course. - ## Docs issues only This repo is for the documentation site. @@ -14,17 +10,21 @@ This repo is for the documentation site. - Got a feature request or product idea? [Propose it on the forum](https://community.n8n.io/c/feature-requests/5). - Found a bug in the product? [Product repo](https://github.com/n8n-io/n8n) +## No course contributions -## Why we might reject your contribution +n8n is working on replacing the course. n8n isn't accepting reports or changes to the current course. -Due to an increase in spam and poor quality contributions, we've introduced new criteria and processes. We will close issues and PRs that are low-effort and poor quality. +## Why n8n might reject your contribution + +Due to an increase in spam and poor quality contributions, n8n has introduced new criteria and processes. n8n will close issues and PRs that are low-effort and poor quality. | Label | Action | Notes | | ----- | ------ | ----- | -| `spam` | Close PR/issue; account blocked | This label is applied to things like empty issues. | -| `ai-slop` | Close PR/issue; account blocked | This label is applied when content is bad, wrong, and looks like it's probably the result of using AI. n8n isn't banning use of AI in contributions, so long as the contributions are high quality. | -| `low-effort-bad` | Close PR/issue; comment with contribution guidance; a second `low-effort-bad` leads to a block. | To avoid this, test your work to make sure it's accurate; follow the [style guide](https://github.com/n8n-io/n8n-docs/wiki/Styles); write meaningful titles and descriptions on your PR/issue. | -| `duplicate` | Close PR/issue; comment with contribution guidance; a second `duplicate` leads to a block. | To avoid this, check existing issues and PRs | +| `spam` | Close PR/issue; account blocked | This label is for things like empty issues. | +| `ai-slop` | Close PR/issue; account blocked | This label is for when content is bad, wrong, and looks like it's probably the result of using AI. n8n isn't banning use of AI in contributions, so long as the contributions are high quality. | +| `low-effort-unusable` | Close PR/issue; comment with contribution guidance; a second `low-effort-unusable` leads to a block. | n8n uses this for minor changes which have issues. To avoid this, test your work to make sure it's accurate; follow the [style guide](https://github.com/n8n-io/n8n-docs/wiki/Styles); write meaningful titles and descriptions on your PR/issue. | +| `low-effort-usable` | No action initially. n8n will accept these, but not in large quantities. Too many occurences in a single month will result in n8n reviewing the activity. | +| `duplicate` | Close PR/issue; comment with contribution guidance. | To avoid this, check existing issues and PRs. | ## Style diff --git a/_snippets/integrations/creating-nodes/testing.md b/_snippets/integrations/creating-nodes/testing.md index 0d5d59af9..42a432828 100644 --- a/_snippets/integrations/creating-nodes/testing.md +++ b/_snippets/integrations/creating-nodes/testing.md @@ -36,9 +36,8 @@ You can test your node as you build it by running it in a local n8n instance. ### Troubleshooting -- There's no `custom` directory in `~/.n8n` local installation. +If there's no `custom` directory in `~/.n8n` local installation, you have to create `custom` directory manually and run `npm init`: -You have to create `custom` directory manually and run `npm init` ```shell # In ~/.n8n directory run mkdir custom