diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000..b90000d11 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,45 @@ +version: v1 + +labels: + - label: 'enhancement' + matcher: + title: '^feat(\(\w+\))?: .*' + + - label: 'bug' + matcher: + title: '^fix(\(\w+\))?: .*' + + - label: 'refactor' + matcher: + title: '^refactor(\(\w+\))?: .*' + + - label: 'documentation' + matcher: + title: '^docs(\(\w+\))?: .*' + + - label: 'test' + matcher: + title: '^test(\(\w+\))?: .*' + + - label: 'build' + matcher: + title: '^(ci|build)(\(\w+\))?: .*' + + - label: 'dependency' + matcher: + title: '^(deps)(\(\w+\))?: .*' + +checks: + - context: 'Semantic Pull Request' + description: + success: Ready for review & merge. + failure: Missing semantic label for merge. + labels: + any: + - enhancement + - bug + - refactor + - documentation + - test + - build + - dependency \ No newline at end of file diff --git a/.github/workflows/pr-triage.yml b/.github/workflows/pr-triage.yml new file mode 100644 index 000000000..03f130e1c --- /dev/null +++ b/.github/workflows/pr-triage.yml @@ -0,0 +1,19 @@ +name: Triage PR + +on: + pull_request: + types: [opened, edited, synchronize, ready_for_review] + branches: [master, main] + +permissions: + contents: read # the config file + pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request) + statuses: write # to generate status + checks: write # to generate status + +jobs: + labeler: + name: Labeler + runs-on: ubuntu-latest + steps: + - uses: fuxingloh/multi-labeler@v4 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3358143e7..744575781 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,9 @@ on: - 'release/v**' workflow_dispatch: # For manually running release process to verify codesigning of artifacts +permissions: + contents: write + jobs: release-macos: name: Publish macOS (electron-builder) @@ -30,7 +33,6 @@ jobs: APPLEID_TEAM_ID: ${{ secrets.appleid_teamid }} CSC_LINK: ${{ secrets.mac_certs }} CSC_KEY_PASSWORD: ${{ secrets.mac_certs_password }} - GH_TOKEN: ${{ secrets.gh_token }} NOTARIZE: true - uses: actions/upload-artifact@v4 with: @@ -55,8 +57,6 @@ jobs: OAUTH_CLIENT_ID: ${{ secrets.oauth_client_id }} OAUTH_CLIENT_SECRET: ${{ secrets.oauth_client_secret }} - run: pnpm make:win --publish onTagOrDraft - env: - GH_TOKEN: ${{ secrets.gh_token }} - uses: actions/upload-artifact@v4 with: name: Gitify-release-win @@ -80,8 +80,6 @@ jobs: OAUTH_CLIENT_ID: ${{ secrets.oauth_client_id }} OAUTH_CLIENT_SECRET: ${{ secrets.oauth_client_secret }} - run: pnpm make:linux --publish onTagOrDraft - env: - GH_TOKEN: ${{ secrets.gh_token }} - uses: actions/upload-artifact@v4 with: name: Gitify-release-linux diff --git a/src/components/Header.test.tsx b/src/components/Header.test.tsx index a381c8be8..7633858c7 100644 --- a/src/components/Header.test.tsx +++ b/src/components/Header.test.tsx @@ -1,3 +1,4 @@ +import { MarkGithubIcon } from '@primer/octicons-react'; import { fireEvent, render, screen } from '@testing-library/react'; import { AppContext } from '../context/App'; import { Header } from './Header'; @@ -16,13 +17,13 @@ describe('components/Header.tsx', () => { }); it('should render itself & its children', () => { - const tree = render(
Test Header
); + const tree = render(
Test Header
); expect(tree).toMatchSnapshot(); }); it('should navigate back', () => { - render(
Test Header
); + render(
Test Header
); fireEvent.click(screen.getByLabelText('Go Back')); @@ -36,7 +37,9 @@ describe('components/Header.tsx', () => { fetchNotifications, }} > -
Test Header
+
+ Test Header +
, ); diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 98698d861..3ecddb9e4 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,18 +1,17 @@ -import { ArrowLeftIcon } from '@primer/octicons-react'; -import { type FC, type ReactNode, useContext } from 'react'; +import { ArrowLeftIcon, type Icon } from '@primer/octicons-react'; +import { type FC, useContext } from 'react'; import { useNavigate } from 'react-router-dom'; import { AppContext } from '../context/App'; import { Size } from '../types'; +import { Legend } from './settings/Legend'; interface IHeader { - children: ReactNode; + icon: Icon; + children: string; fetchOnBack?: boolean; } -export const Header: FC = ({ - children, - fetchOnBack = false, -}: IHeader) => { +export const Header: FC = (props: IHeader) => { const navigate = useNavigate(); const { fetchNotifications } = useContext(AppContext); @@ -25,7 +24,7 @@ export const Header: FC = ({ title="Go Back" onClick={() => { navigate(-1); - if (fetchOnBack) { + if (props.fetchOnBack) { fetchNotifications(); } }} @@ -37,7 +36,9 @@ export const Header: FC = ({ /> -

{children}

+

+ {props.children} +

); }; diff --git a/src/components/__snapshots__/Header.test.tsx.snap b/src/components/__snapshots__/Header.test.tsx.snap index 98717155d..b5bf11c58 100644 --- a/src/components/__snapshots__/Header.test.tsx.snap +++ b/src/components/__snapshots__/Header.test.tsx.snap @@ -30,9 +30,28 @@ exports[`components/Header.tsx should render itself & its children 1`] = `

- Test Header + + + Test Header +

@@ -63,9 +82,28 @@ exports[`components/Header.tsx should render itself & its children 1`] = `

- Test Header + + + Test Header +

, diff --git a/src/routes/Accounts.tsx b/src/routes/Accounts.tsx index 41a859ffa..60e77c572 100644 --- a/src/routes/Accounts.tsx +++ b/src/routes/Accounts.tsx @@ -45,7 +45,7 @@ export const AccountsRoute: FC = () => { return (
-
Accounts
+
Accounts
{auth.accounts.map((account) => ( diff --git a/src/routes/Filters.tsx b/src/routes/Filters.tsx index 295044fd9..7b40c5d92 100644 --- a/src/routes/Filters.tsx +++ b/src/routes/Filters.tsx @@ -1,11 +1,13 @@ import { FeedPersonIcon, + FilterIcon, FilterRemoveIcon, NoteIcon, } from '@primer/octicons-react'; import { type FC, useContext } from 'react'; import { Header } from '../components/Header'; import { Checkbox } from '../components/fields/Checkbox'; +import { Legend } from '../components/settings/Legend'; import { AppContext } from '../context/App'; import { BUTTON_CLASS_NAME } from '../styles/gitify'; import { Size } from '../types'; @@ -33,13 +35,12 @@ export const FiltersRoute: FC = () => { return (
-
Filters
+
+ Filters +
- - - Users - + Users {
- - - Reason - + Reason Note: if no reasons are selected, all notifications will be shown. diff --git a/src/routes/LoginWithOAuthApp.tsx b/src/routes/LoginWithOAuthApp.tsx index bd3b26573..9d0e7df3e 100644 --- a/src/routes/LoginWithOAuthApp.tsx +++ b/src/routes/LoginWithOAuthApp.tsx @@ -128,10 +128,7 @@ export const LoginWithOAuthApp: FC = () => { return (
-
- - Login with OAuth App -
+
Login with OAuth App
{ return ( <> -
- - Login with Personal Access Token -
+
Login with Personal Access Token
{ const { resetSettings } = useContext(AppContext); return (
-
Settings
+
+ Settings +
diff --git a/src/routes/__snapshots__/Accounts.test.tsx.snap b/src/routes/__snapshots__/Accounts.test.tsx.snap index 30e6212d1..da96fff28 100644 --- a/src/routes/__snapshots__/Accounts.test.tsx.snap +++ b/src/routes/__snapshots__/Accounts.test.tsx.snap @@ -30,9 +30,28 @@ exports[`routes/Accounts.tsx General should render itself & its children 1`] = `

- Accounts + + + Accounts +

- Filters + + + Filters +

- - Login with OAuth App + + Login with OAuth App +

- - Login with OAuth App + + Login with OAuth App +

- - Login with Personal Access Token + + Login with Personal Access Token +

- - Login with Personal Access Token + + Login with Personal Access Token +

- Settings + + + Settings +