Skip to content

Commit 8190d73

Browse files
committed
chore: Add deprecation workflow
1 parent d5d20eb commit 8190d73

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/deprecate.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deprecate version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Package version'
8+
required: true
9+
type: string
10+
latest:
11+
description: 'Latest version'
12+
type: string
13+
14+
jobs:
15+
update-package:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Setup Node 22
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
registry-url: 'https://registry.npmjs.org'
24+
cache: 'npm'
25+
- uses: codex-team/action-nodejs-package-info@v1
26+
id: package
27+
- name: Deprecate target version
28+
env:
29+
GH_TOKEN: ${{ secrets.YC_UI_BOT_GITHUB_TOKEN }}
30+
run: |
31+
set -e
32+
33+
PACKAGE="${{ steps.package.outputs.name }}"
34+
LATEST="$(npm view $PACKAGE@latest | grep -e "$PACKAGE@[0-9.]*" -o)"
35+
VERSION="${{ inputs.version }}"
36+
TARGET="$PACKAGE@$VERSION"
37+
38+
if [[ $LATEST == $TARGET ]]; then
39+
if [[ -z "${{ inputs.latest }}" ]]; then
40+
echo "::error::Param 'latest' should be configured to previous version, to deprecate latest version"
41+
exit 1
42+
fi
43+
fi
44+
45+
echo "Deprecate $TARGET"

scripts/deprecate.sh

Whitespace-only changes.

0 commit comments

Comments
 (0)