Skip to content

deprecate_release

deprecate_release #23

name: deprecate_release
on:
workflow_dispatch:
inputs:
deprecationMessage:
required: true
type: string
description: The deprecation message to apply to the affected package versions.
useNpmRegistry:
required: false
type: boolean
default: false
description: |
Whether to run the workflow against the live npm registry or not.
Defaults to false. Must be explicitly set to true to run against the npm registry.
searchForReleaseStartingFrom:
required: false
type: string
default: HEAD
description: |
By default, the most recent release from HEAD (inclusive) of the target branch will be deprecated.
To deprecate a different release, specify the release commit to deprecate here.
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # version 3.6.0
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/install_with_cache
deprecate_release:
needs:
- install
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# mapping the inputs to these environment variables allows the @actions/core toolkit to pick up the inputs
INPUT_DEPRECATIONMESSAGE: ${{ inputs.deprecationMessage }}
INPUT_USENPMREGISTRY: ${{ inputs.useNpmRegistry }}
INPUT_SEARCHFORRELEASESTARTINGFROM: ${{ inputs.searchForReleaseStartingFrom }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # version 3.6.0
with:
# fetch full history so that we can properly lookup past releases
fetch-depth: 0
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/restore_install_cache
- name: Deprecate release versions
run: npx tsx scripts/deprecate_release.ts