Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
id: ver
run: |
BASE=$(node -p "require('./package.json').version" | sed 's/-.*//')
# GitHub 태그/릴리즈는 SemVer prerelease 표기를 쓴다.
echo "tag=v${BASE}-beta.${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT"
# manifest version 은 숫자만 허용 → 4-파트 숫자 스킴으로 별도 계산.
echo "manifest=${BASE}.${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT"

- name: 의존성 설치
run: npm ci
Expand All @@ -38,6 +41,7 @@ jobs:
run: npm run build
env:
RELEASE_CHANNEL: beta
BETA_VERSION: ${{ steps.ver.outputs.manifest }}

- name: dist 압축
env:
Expand All @@ -58,8 +62,8 @@ jobs:

# ── 베타 Chrome Web Store 게시 (기반 — 기본 비활성) ──────────────
# 베타는 별도 스토어 항목이므로 BETA_EXTENSION_ID 사용.
# ※ Chrome manifest version은 숫자만 허용되므로, 스토어 발행을 켤 때는
# `-beta.N` 대신 숫자 스킴(예: x.y.z.N)으로 manifest 버전을 맞춰야 함.
# manifest 버전은 위 빌드에서 BETA_VERSION(숫자 4-파트)으로 주입되어
# 스토어 버전 규칙(숫자만 허용)을 만족한다.
- name: Chrome Web Store 게시 (beta)
if: vars.ENABLE_STORE_PUBLISH == 'true'
uses: mnao305/chrome-extension-upload@4008e29e13c144d0f6725462cbd49b7c291b4928 # v5.0.0
Expand Down
28 changes: 19 additions & 9 deletions manifest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,37 @@ import packageJson from './package.json' with { type: 'json' };

const PROD_CLIENT_ID = '804067218183-3pev3tppten6i94lrfvmk729hmbdejqb.apps.googleusercontent.com';
const DEV_CLIENT_ID = '981860765955-t69elhj8osi7vdp84m5bf8b9hdib44kr.apps.googleusercontent.com';
// 베타는 별도 스토어 항목 = 별도 확장 ID로 게시되므로, 그 확장 ID에 묶인
// 전용 OAuth client_id 가 필요하다. (스테이블용 PROD_CLIENT_ID 로는 베타에서
// chrome.identity 토큰 검증이 실패한다.)
// TODO(#112): 베타 스토어 항목 생성 후 발급받은 client_id 로 교체.
const BETA_CLIENT_ID = '';

export function createManifest(mode?: string): ManifestV3Export {
const clientId = mode === 'mock' ? DEV_CLIENT_ID : PROD_CLIENT_ID;

// 베타 채널 빌드 기반 (Chrome Web Store 2단계 게시 대비)
// 베타 채널 빌드 (Chrome Web Store 별도 항목 게시 대비)
// 릴리즈 워크플로의 베타 빌드에서 RELEASE_CHANNEL=beta 를 주입하면
// 별도 스토어 항목/아이콘과 구분되도록 이름에 (Beta) 가 붙는다.
// 이름에 (Beta) 가 붙고, 별도 아이콘/OAuth client_id 로 분기된다.
const isBeta = process.env.RELEASE_CHANNEL === 'beta';

const clientId = mode === 'mock' ? DEV_CLIENT_ID : isBeta ? BETA_CLIENT_ID : PROD_CLIENT_ID;
Comment on lines +6 to +18

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

BETA_CLIENT_ID 로 인해 모든 베타 빌드의 OAuth 가 동작하지 않습니다.

isBeta 인 빌드에서는 clientId 가 빈 문자열(BETA_CLIENT_ID = '')로 설정되어 oauth2.client_id 가 비게 됩니다(Line 18 → Line 56). 베타 빌드 스텝(RELEASE_CHANNEL=beta)은 ENABLE_STORE_PUBLISH 게이트와 무관하게 항상 실행되어 그 산출물이 프리릴리즈 zip 으로 첨부되므로, 베타 테스터가 받는 빌드는 chrome.identity 토큰 검증이 실패하거나 매니페스트 로드 자체가 거부될 수 있습니다.

#112 로 발급받은 실제 client_id 로 교체되기 전까지는 베타 산출물이 배포되지 않도록 하거나, 빈 값일 때 빌드를 명시적으로 실패시키는 가드를 두는 것을 권장합니다.

BETA_CLIENT_ID 가 비어 있을 때 베타 빌드를 조기에 실패시키는 가드를 추가하는 변경을 원하시면 도와드리거나, #112 추적을 위한 이슈 정리를 도와드릴까요?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@manifest.config.ts` around lines 6 - 18, The beta manifest path in
createManifest currently uses BETA_CLIENT_ID even when it is an empty string,
which leaves oauth2.client_id invalid for beta builds. Update createManifest to
guard the isBeta branch so beta builds fail fast or fall back only when a real
beta client ID is present, and keep the mock/production selection intact via
mode, isBeta, BETA_CLIENT_ID, and PROD_CLIENT_ID. Make the check explicit near
the clientId assignment so any RELEASE_CHANNEL=beta build cannot proceed with an
empty OAuth client ID.

const iconPrefix = isBeta ? 'icon-beta' : 'icon';

// Chrome manifest version 은 숫자 점 표기만 허용하므로 `-beta.N` 을 못 쓴다.
// 베타 워크플로는 BETA_VERSION 으로 4-파트 숫자(X.Y.Z.RUN_NUMBER)를 주입한다.
const version = isBeta && process.env.BETA_VERSION ? process.env.BETA_VERSION : packageJson.version;

return {
manifest_version: 3,
name: isBeta ? '__MSG_extName__ (Beta)' : '__MSG_extName__',
version: packageJson.version,
version,
description: '__MSG_extDescription__',
default_locale: 'ko',
action: {},
icons: {
'16': 'images/icon/icon-16.png',
'32': 'images/icon/icon-32.png',
'48': 'images/icon/icon-48.png',
'128': 'images/icon/icon-128.png',
'16': `images/icon/${iconPrefix}-16.png`,
'32': `images/icon/${iconPrefix}-32.png`,
'48': `images/icon/${iconPrefix}-48.png`,
'128': `images/icon/${iconPrefix}-128.png`,
},
background: {
service_worker: 'src/background.ts',
Expand Down
Binary file added public/images/icon/icon-beta-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/icon-beta-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/icon-beta-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/icon-beta-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading