File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments