Skip to content
Merged
Changes from 1 commit
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
37 changes: 37 additions & 0 deletions .github/workflows/deprecation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deprecation ⚠️

on:
workflow_dispatch:
inputs:
version:
description: "deprecated 할 버전 (예: 1.2.3)"
required: true
type: string
reason:
description: "deprecation 사유"
required: true
type: string

jobs:
deprecated:
runs-on: ubuntu-latest
steps:
- name: Validate version format
run: |
VERSION="${{ inputs.version }}"
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Invalid version format: $VERSION"
echo "Version must be in format: X.Y.Z (e.g., 1.2.3)"
exit 1
fi

- uses: actions/checkout@v6 # package.json 파일을 읽기 위해서 사용
- uses: actions/setup-node@v6
with:
registry-url: "https://registry.npmjs.org" # npmrc 자동 생성을 위해서 사용
- name: Deprecate npm package version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
PACKAGE_NAME=$(jq -r .name package.json)
npm deprecate "$PACKAGE_NAME@${{ inputs.version }}" "${{ inputs.reason }}"
Copy link
Member

Choose a reason for hiding this comment

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

저도 이런 워크플로우는 작성해보지 않아서 잘 모르겠지만, 제가 알아보기로는 npm deprecate 하기 전에 npm view package@version을 호출하면 해당 버전이 실제로 존재하는지 사전에 검증할 수 있다고 합니다.

Copy link
Member

Choose a reason for hiding this comment

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

그런 검증이 굳이 필요할까요? 버전이 없으면 npm deprecate가 버전이 없다는 메시지와 함께 실패할 것입니다.

Copy link
Contributor Author

@hyoseong1994 hyoseong1994 Jan 7, 2026

Choose a reason for hiding this comment

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

에반님 좋은의견 감사합니다. 달레님 말씀대로 npm deprecate가 메시지를 주지만 실패코드로 주지는 않는걸로 확인했습니다.
(deprecate는 이 버전은 쓰지말라이지만 이미없는 버전이니 정상처리라고 표현한것으로 예상됩니다.)

image

따라서 에반님이 제안주신대로 npm view package@version 를 사용하여 404에 대해서 validation을 추가하는것이 올바르다고 생각됩니다.
(참고로 deprecate된 버전에 경우 message 수정때문에 재요청할수있어서 404에 대해서만 실패 처리하는것으로 제안합니다.)

Copy link
Member

Choose a reason for hiding this comment

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

@hyoseong1994 직접 실행까지 해서 검증해주셔서 감사합니다. 버전이 없다면 실패 메시지를 던지는 게 바람직한 워크플로우라고 생각해요.

Copy link
Contributor Author

@hyoseong1994 hyoseong1994 Jan 7, 2026

Choose a reason for hiding this comment

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

작업완료했습니다 확인하시고 다른 의견있으시면 피드백 부탁드립니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sounmind 안녕하세요 에반님 작업이 완료되어 리마인드 드립니다.
@DaleSeo 달레님 의견 달아주시고 별다른 피드백이 없어서 혹시나 싶어 태그합니다. 이모지라도 하나 달아주시면 감사하겠습니다. :)

Copy link
Member

Choose a reason for hiding this comment

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

@hyoseong1994 님, 앞으로 승인한 PR은 저한테 다시 확인 안 받으셔도 됩니다. 다시 확인 받으실 만큼 추가 변경이 있을 때는 🔄 버튼 눌러서 명시적으로 요청해주세용~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아하 알겠습니다! 다음부터는 🔄 로 요청하겠습니다.