Repository navigation
[BASE-A5] Sidebar block templates ship “Mussum Ipsum” lorem text by default #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Audit Claims | |
| on: | |
| issues: | |
| types: [opened, closed, reopened, edited, labeled, unlabeled, assigned, unassigned, deleted] | |
| permissions: | |
| issues: write | |
| contents: write | |
| concurrency: | |
| group: audit-claims | |
| cancel-in-progress: false | |
| jobs: | |
| manage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Auto-assign claim author on creation | |
| if: github.event.action == 'opened' && contains(github.event.issue.labels.*.name, 'claim') | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issue = context.payload.issue; | |
| const author = issue.user.login; | |
| const assigned = (issue.assignees || []).map(a => a.login); | |
| if (!assigned.includes(author)) { | |
| await github.rest.issues.addAssignees({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| assignees: [author], | |
| }); | |
| } | |
| - name: Regenerate audit-claims.json | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const issues = await github.paginate(github.rest.issues.listForRepo, { | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: 'claim', | |
| state: 'all', | |
| per_page: 100, | |
| }); | |
| const idRe = /^\[([A-Z]+-[A-Z]\d+)\]/; | |
| const claims = issues | |
| .filter(i => !i.pull_request) | |
| .map(i => { | |
| const m = i.title.match(idRe); | |
| if (!m) return null; | |
| return { | |
| itemId: m[1], | |
| number: i.number, | |
| url: i.html_url, | |
| title: i.title, | |
| state: i.state, | |
| stateReason: i.state_reason, | |
| assignees: (i.assignees || []).map(a => ({ | |
| login: a.login, | |
| avatar_url: a.avatar_url, | |
| html_url: a.html_url, | |
| })), | |
| updatedAt: i.updated_at, | |
| }; | |
| }) | |
| .filter(Boolean); | |
| fs.writeFileSync('audit-claims.json', JSON.stringify(claims, null, 2) + '\n'); | |
| - name: Commit if changed | |
| run: | | |
| if git diff --quiet -- audit-claims.json; then | |
| echo "No changes to audit-claims.json" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add audit-claims.json | |
| git commit -m "Update audit-claims.json [skip ci]" | |
| git push |