mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 12:28:06 +08:00
* ci: pin actions to commit SHAs and add shellcheck Pin actions/github-script in catalog-assign.yml to a full commit SHA; all other workflows were already pinned. Add a repo-wide regression test that every workflow `uses:` ref is pinned to a 40-char commit SHA. Add a shellcheck job to lint.yml (--severity=error over scripts/bash/*.sh) and document the local command in CONTRIBUTING.md. * ci: use repo-standard actions/checkout v7.0.0 in shellcheck job * ci: shellcheck all tracked shell scripts Assisted-by: Codex (model: GPT-5, autonomous) * ci: address workflow hygiene review feedback Assisted-by: Codex (model: GPT-5, autonomous)
60 lines
2.1 KiB
YAML
60 lines
2.1 KiB
YAML
name: "Catalog: Auto-assign submission"
|
|
|
|
on:
|
|
issues:
|
|
types: [opened, labeled]
|
|
|
|
jobs:
|
|
assign:
|
|
if: >
|
|
(github.event.action == 'opened' && (
|
|
contains(github.event.issue.labels.*.name, 'extension-submission') ||
|
|
contains(github.event.issue.labels.*.name, 'preset-submission')
|
|
)) ||
|
|
(github.event.action == 'labeled' && (
|
|
github.event.label.name == 'extension-submission' ||
|
|
github.event.label.name == 'preset-submission'
|
|
))
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: write
|
|
steps:
|
|
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
|
with:
|
|
script: |
|
|
const issue = context.payload.issue;
|
|
const assigned = (issue.assignees || []).map(a => a.login);
|
|
const marker = '<!-- catalog-assign-bot -->';
|
|
|
|
// Assign mnriem if not already assigned
|
|
if (!assigned.includes('mnriem')) {
|
|
try {
|
|
await github.rest.issues.addAssignees({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
assignees: ['mnriem'],
|
|
});
|
|
} catch (e) {
|
|
console.log(`Warning: could not assign mnriem: ${e.message}`);
|
|
}
|
|
}
|
|
|
|
// Post team notification if not already posted
|
|
const comments = await github.paginate(
|
|
github.rest.issues.listComments,
|
|
{
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
}
|
|
);
|
|
if (!comments.some(c => c.body && c.body.includes(marker))) {
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: marker + '\ncc @github/spec-kit-maintainers — new catalog submission for review.',
|
|
});
|
|
}
|