-
Notifications
You must be signed in to change notification settings - Fork 73
57 lines (54 loc) · 1.93 KB
/
restore_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: restore_release
on:
workflow_dispatch:
inputs:
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 restored.
To restore a different release, specify the release commit to restore here.
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # version 4.1.4
- uses: ./.github/actions/setup_node
with:
node-version: 18
- uses: ./.github/actions/install_with_cache
with:
node-version: 18
cdk-version: FROM_PACKAGE_LOCK
restore_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_USENPMREGISTRY: ${{ inputs.useNpmRegistry }}
INPUT_SEARCHFORRELEASESTARTINGFROM: ${{ inputs.searchForReleaseStartingFrom }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # version 4.1.4
with:
# fetch full history so that we can properly lookup past releases
fetch-depth: 0
- uses: ./.github/actions/setup_node
with:
node-version: 18
- uses: ./.github/actions/restore_install_cache
with:
node-version: 18
cdk-version: FROM_PACKAGE_LOCK
- name: Restore release versions
run: npx tsx scripts/restore_release.ts