diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml index aaec6f3a..dfc3be67 100644 --- a/.github/workflows/auto-author-assign.yml +++ b/.github/workflows/auto-author-assign.yml @@ -1,14 +1,48 @@ -name: Auto Author Assign +name: Auto Assign Author on: - pull_request_target: + pull_request: + types: [opened, reopened, ready_for_review] + issues: types: [opened, reopened] permissions: + issues: write pull-requests: write jobs: - assign-author: + auto-assign: runs-on: ubuntu-latest steps: - - uses: toshimaru/auto-author-assign@v1.6.2 + - name: Assign to author + uses: actions/github-script@v7 + with: + script: | + const isPR = !!context.payload.pull_request; + const item = isPR ? context.payload.pull_request : context.payload.issue; + const number = item.number; + const owner = context.repo.owner; + const repo = context.repo.repo; + const assignee = item.user.login; + const alreadyAssigned = (item.assignees || []).some( + (existing) => existing.login === assignee + ); + + if (alreadyAssigned) { + console.log(`${assignee} is already assigned to #${number}.`); + return; + } + + try { + await github.rest.issues.addAssignees({ + owner, + repo, + issue_number: number, + assignees: [assignee], + }); + console.log(`Assigned ${assignee} to #${number}.`); + } catch (error) { + console.log( + `Skipping assignment for #${number}: ${error.message || String(error)}` + ); + } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 590eac7a..5324d6d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,10 +2,6 @@ name: Build on: push -env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - jobs: format-check: runs-on: ubuntu-latest diff --git a/.github/workflows/format-and-lint.yml b/.github/workflows/format-and-lint.yml index bebba0e2..b3b17e91 100644 --- a/.github/workflows/format-and-lint.yml +++ b/.github/workflows/format-and-lint.yml @@ -2,10 +2,6 @@ name: Format Checks and Linting on: push -env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - jobs: format-check: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d298f3a6..d44a4822 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,12 @@ +# Disabled for fork: no npm publish or GH_TOKEN. Re-enable and set secrets if you publish. name: Semantic Release CI on: - push: - branches: [main, beta] + workflow_dispatch: # was: push branches [main, beta] -env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +# env: +# GH_TOKEN: ${{ secrets.GH_TOKEN }} +# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} permissions: packages: write diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 41894dd3..70a78647 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,9 +2,9 @@ name: Verify on: push: + branches: [main] pull_request: - branches: - - main + branches: [main] jobs: verify: diff --git a/.github/workflows/type-check.yaml b/.github/workflows/type-check.yaml index e72b6563..8e8493d4 100644 --- a/.github/workflows/type-check.yaml +++ b/.github/workflows/type-check.yaml @@ -2,10 +2,6 @@ name: Type Check on: push -env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - jobs: format-check: runs-on: ubuntu-latest diff --git a/src/components/dialog/dialog.test.tsx b/src/components/dialog/dialog.test.tsx index 58223772..b01de53d 100644 --- a/src/components/dialog/dialog.test.tsx +++ b/src/components/dialog/dialog.test.tsx @@ -5,7 +5,7 @@ import { Dialog } from './dialog' describe('Dialog', () => { it('renders content and triggers onClose from the close button', async () => { const onClose = vi.fn() - const { container } = render( + render( Dialog content , diff --git a/src/components/form-field/form-field-group.stories.tsx b/src/components/form-field/form-field-group.stories.tsx index 6c212a23..c5af1f1a 100644 --- a/src/components/form-field/form-field-group.stories.tsx +++ b/src/components/form-field/form-field-group.stories.tsx @@ -1,6 +1,5 @@ /* eslint-disable react/jsx-props-no-spreading */ import type { Meta, StoryObj } from '@storybook/react-vite' -import { FormFieldGroup } from './form-field-group' import { FormField } from './form-field' type FormFieldGroupStoryArgs = { diff --git a/src/components/form-field/radio-box/radio-box.stories.tsx b/src/components/form-field/radio-box/radio-box.stories.tsx index 9355a238..db3d0c1f 100644 --- a/src/components/form-field/radio-box/radio-box.stories.tsx +++ b/src/components/form-field/radio-box/radio-box.stories.tsx @@ -1,7 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react-vite' import { useEffect, useState } from 'react' import { FormField } from '../form-field' -import { RadioBox } from './radio-box' import { FeaturedTag } from '../../featured-tag/featured-tag' type RadioBoxStoryArgs = {