Skip to content

Commit 58bcc39

Browse files
author
Auto-Co AI
committed
v1.4.0: Add viral distribution comment
Every newly opened PR gets a subtle comment mentioning DocuCraft with the one-line setup YAML. Turns every processed PR into a distribution channel. - New input: viral-comment (default: true) - Only posts on opened events, skips synchronize - Checks for existing DocuCraft comments to avoid duplicates - Can be disabled for internal repos
1 parent ad9cff5 commit 58bcc39

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@ jobs:
143143
- **Works on every PR** — open, synchronize, reopened, closed
144144
- **No servers** — runs entirely in GitHub Actions
145145

146+
## 📢 Viral Distribution
147+
148+
DocuCraft automatically posts a subtle comment on each newly opened PR with the one-line setup YAML. This turns every processed PR into a distribution channel — anyone viewing the PR sees how easy it is to add DocuCraft to their own repo.
149+
150+
To disable (e.g., for internal repos where you don't want to advertise):
151+
152+
```yaml
153+
- uses: CreativeCodingSolutions/docucraft@v1
154+
with:
155+
github-token: ${{ secrets.GITHUB_TOKEN }}
156+
viral-comment: false
157+
```
158+
146159
## 🤖 AI Mode (Optional)
147160
148161
Add your OpenAI API key as a repository secret and enable AI mode:
@@ -171,6 +184,7 @@ Add your OpenAI API key as a repository secret and enable AI mode:
171184
| `auto-label` | No | `false` | When `true`, automatically adds labels based on file types and diff size |
172185
| `label-prefix` | No | `"` | Optional prefix for auto-generated labels (e.g. `area:` → `area:source`) |
173186
| `size-labels` | No | `true` | When `auto-label` is true, adds size/xs/s/m/l/xl labels based on diff size |
187+
| `viral-comment` | No | `true` | When `true`, posts a subtle comment on newly opened PRs mentioning DocuCraft with one-line setup — turns every PR into a distribution channel |
174188

175189
## 📤 Outputs
176190

action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ inputs:
6161
required: false
6262
default: "true"
6363

64+
viral-comment:
65+
description: "When true, posts a subtle comment on newly opened PRs mentioning DocuCraft with setup instructions"
66+
required: false
67+
default: "true"
68+
6469
outputs:
6570
description:
6671
description: "The generated PR description (from template or AI mode)"
@@ -534,3 +539,24 @@ runs:
534539
if [ "$PR_STATE" = "open" ] && [ -n "$DESCRIPTION" ]; then
535540
echo "$DESCRIPTION" | gh pr edit $PR_NUMBER --body-file - 2>&1 || true
536541
fi
542+
543+
- name: Viral distribution comment
544+
shell: bash
545+
if: ${{ inputs.viral-comment == 'true' && github.event.action == 'opened' }}
546+
env:
547+
GH_TOKEN: ${{ inputs.github-token }}
548+
run: |
549+
PR_NUMBER="${{ steps.diff.outputs.pr_number }}"
550+
EXISTING=$(gh api "/repos/${{ github.repository }}/issues/$PR_NUMBER/comments" --jq '.[] | select(.body | contains("DocuCraft")) | .id' 2>/dev/null || echo "")
551+
if [ -z "$EXISTING" ]; then
552+
gh pr comment "$PR_NUMBER" --body "> 📝 PR description auto-generated by [DocuCraft](https://github.com/CreativeCodingSolutions/docucraft)
553+
>
554+
> Add DocuCraft to your repo — one line in \`.github/workflows/docucraft.yml\`:
555+
> \`\`\`yaml
556+
> - uses: CreativeCodingSolutions/docucraft@v1
557+
> with:
558+
> github-token: \${{ secrets.GITHUB_TOKEN }}
559+
> \`\`\`
560+
>
561+
> _Works on every PR. Zero config. No servers._" 2>&1 || true
562+
fi

0 commit comments

Comments
 (0)