Skip to content

Commit 799fb00

Browse files
authored
Merge pull request #26 from marklearst/fix/ci-workflows-and-lint
chore: fix CI for fork — lint fixes, drop NPM/GH_TOKEN, disable release
2 parents bedc244 + 0e426ec commit 799fb00

9 files changed

Lines changed: 46 additions & 26 deletions

File tree

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,48 @@
1-
name: Auto Author Assign
1+
name: Auto Assign Author
22

33
on:
4-
pull_request_target:
4+
pull_request:
5+
types: [opened, reopened, ready_for_review]
6+
issues:
57
types: [opened, reopened]
68

79
permissions:
10+
issues: write
811
pull-requests: write
912

1013
jobs:
11-
assign-author:
14+
auto-assign:
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: toshimaru/auto-author-assign@v1.6.2
17+
- name: Assign to author
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
const isPR = !!context.payload.pull_request;
22+
const item = isPR ? context.payload.pull_request : context.payload.issue;
23+
const number = item.number;
24+
const owner = context.repo.owner;
25+
const repo = context.repo.repo;
26+
const assignee = item.user.login;
27+
const alreadyAssigned = (item.assignees || []).some(
28+
(existing) => existing.login === assignee
29+
);
30+
31+
if (alreadyAssigned) {
32+
console.log(`${assignee} is already assigned to #${number}.`);
33+
return;
34+
}
35+
36+
try {
37+
await github.rest.issues.addAssignees({
38+
owner,
39+
repo,
40+
issue_number: number,
41+
assignees: [assignee],
42+
});
43+
console.log(`Assigned ${assignee} to #${number}.`);
44+
} catch (error) {
45+
console.log(
46+
`Skipping assignment for #${number}: ${error.message || String(error)}`
47+
);
48+
}

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Build
22

33
on: push
44

5-
env:
6-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
7-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8-
95
jobs:
106
format-check:
117
runs-on: ubuntu-latest

.github/workflows/format-and-lint.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Format Checks and Linting
22

33
on: push
44

5-
env:
6-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
7-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8-
95
jobs:
106
format-check:
117
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
# Disabled for fork: no npm publish or GH_TOKEN. Re-enable and set secrets if you publish.
12
name: Semantic Release CI
23

34
on:
4-
push:
5-
branches: [main, beta]
5+
workflow_dispatch: # was: push branches [main, beta]
66

7-
env:
8-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
9-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7+
# env:
8+
# GH_TOKEN: ${{ secrets.GH_TOKEN }}
9+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1010

1111
permissions:
1212
packages: write

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Verify
22

33
on:
44
push:
5+
branches: [main]
56
pull_request:
6-
branches:
7-
- main
7+
branches: [main]
88

99
jobs:
1010
verify:

.github/workflows/type-check.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Type Check
22

33
on: push
44

5-
env:
6-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
7-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8-
95
jobs:
106
format-check:
117
runs-on: ubuntu-latest

src/components/dialog/dialog.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Dialog } from './dialog'
55
describe('Dialog', () => {
66
it('renders content and triggers onClose from the close button', async () => {
77
const onClose = vi.fn()
8-
const { container } = render(
8+
render(
99
<Dialog isShown title='Confirm action' onClose={onClose}>
1010
Dialog content
1111
</Dialog>,

src/components/form-field/form-field-group.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable react/jsx-props-no-spreading */
22
import type { Meta, StoryObj } from '@storybook/react-vite'
3-
import { FormFieldGroup } from './form-field-group'
43
import { FormField } from './form-field'
54

65
type FormFieldGroupStoryArgs = {

src/components/form-field/radio-box/radio-box.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { Meta, StoryObj } from '@storybook/react-vite'
22
import { useEffect, useState } from 'react'
33
import { FormField } from '../form-field'
4-
import { RadioBox } from './radio-box'
54
import { FeaturedTag } from '../../featured-tag/featured-tag'
65

76
type RadioBoxStoryArgs = {

0 commit comments

Comments
 (0)