Files
awesome-openclaw-skills/.github/workflows/pr-check.yml
2026-03-10 13:12:51 +03:00

40 lines
1.5 KiB
YAML

name: PR Description Check
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- name: Check PR description for required links
uses: actions/github-script@v7
with:
script: |
const body = context.payload.pull_request.body || '';
const hasClawhubLink = /https:\/\/clawhub\.ai\/[\w-]+\/[\w-]+/.test(body);
const hasGithubLink = /https:\/\/github\.com\/openclaw\/skills\/tree\/main\/skills\/[\w-]+\/[\w-]+/.test(body);
const errors = [];
if (!hasClawhubLink) {
errors.push('Missing ClawHub link (e.g. https://clawhub.ai/steipete/slack)');
}
if (!hasGithubLink) {
errors.push('Missing GitHub link (e.g. https://github.com/openclaw/skills/tree/main/skills/steipete/slack)');
}
if (errors.length > 0) {
const message = `## ❌ PR Description Check Failed\n\nYour PR description must include both links:\n\n${errors.map(e => '- ' + e).join('\n')}\n\nSee [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md#pr-description) for details.`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: message
});
core.setFailed('PR description is missing required links.');
}