|
| 1 | +name: PR Welcome Message |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened] |
| 6 | + |
| 7 | +jobs: |
| 8 | + welcome: |
| 9 | + runs-on: ubuntu-22.04 |
| 10 | + permissions: |
| 11 | + issues: write |
| 12 | + pull-requests: write |
| 13 | + steps: |
| 14 | + - name: Post welcome message |
| 15 | + uses: actions/github-script@v7 |
| 16 | + with: |
| 17 | + script: | |
| 18 | + const welcomeMessage = [ |
| 19 | + '👋 **Thanks for your contribution!**', |
| 20 | + '', |
| 21 | + 'This PR will run CI tests based on the files you changed. If some tests are skipped and you want to run the full test suite (including minimum dependency tests), you can use these commands:', |
| 22 | + '', |
| 23 | + '### CI Control Commands', |
| 24 | + '', |
| 25 | + '- **`/run-skipped-ci`** - Runs all skipped CI checks and enables full CI mode for this PR', |
| 26 | + ' - Adds the `full-ci` label to ensure future commits also run the full test suite', |
| 27 | + ' - Useful when you want comprehensive testing across all configurations', |
| 28 | + '', |
| 29 | + '- **`/stop-run-skipped-ci`** - Disables full CI mode and returns to standard CI', |
| 30 | + ' - Removes the `full-ci` label', |
| 31 | + ' - Future commits will only run tests for changed files', |
| 32 | + '', |
| 33 | + '💡 **Note:** The `full-ci` label will be automatically removed when this PR is merged.', |
| 34 | + '', |
| 35 | + 'View CI progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).' |
| 36 | + ].join('\n'); |
| 37 | +
|
| 38 | + await github.rest.issues.createComment({ |
| 39 | + owner: context.repo.owner, |
| 40 | + repo: context.repo.repo, |
| 41 | + issue_number: context.issue.number, |
| 42 | + body: welcomeMessage |
| 43 | + }); |
| 44 | +
|
| 45 | + console.log('✅ Posted welcome message to PR'); |
0 commit comments