mirror of
https://github.com/vercel/next-learn.git
synced 2026-06-11 09:51:47 +00:00
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
32 lines
998 B
YAML
32 lines
998 B
YAML
name: Validate Issue
|
|
on:
|
|
issues:
|
|
types: [opened]
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check chapter URL
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const body = context.payload.issue.body || '';
|
|
const hasValidUrl = body.includes('nextjs.org/learn');
|
|
|
|
if (!hasValidUrl) {
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: 'This issue was automatically closed because it doesn\'t reference a valid nextjs.org/learn URL.'
|
|
});
|
|
await github.rest.issues.update({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
state: 'closed',
|
|
state_reason: 'not_planned'
|
|
});
|
|
}
|