-
Notifications
You must be signed in to change notification settings - Fork 870
47 lines (47 loc) · 1.45 KB
/
update_dependencies_pr.yml
File metadata and controls
47 lines (47 loc) · 1.45 KB
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
name: Open a PR with updated dependencies
on:
workflow_dispatch:
inputs:
dependencies:
description: JSON-serialized map of dependencies to update
type: string
required: true
upstream_repository:
description: Upstream repository to open the PR in
type: string
required: true
fork_repository:
description: Fork repository to create the branch in
type: string
required: true
jobs:
checkout:
name: Checkout the repository
runs-on: ubuntu-latest
steps:
- name: Verify dependencies input
env:
DEPENDENCIES: ${{ inputs.dependencies }}
# language=bash
run: |
num_deps=$(jq 'map(select(has("package") and has("version"))) | length' <<< "$DEPENDENCIES")
if [[ "$?" -ne 0 ]]; then
echo "::error:: Invalid dependencies input"
exit 2
elif [[ "$num_deps" -eq 0 ]]; then
echo "::warning:: No dependencies to update"
exit 1
else
echo "$num_deps dependencies to update"
fi
- uses: actions/checkout@v6
with:
repository: ${{ inputs.upstream_repository }}
fetch-depth: 1
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: yarn
package-manager-cache: false
- name: Update dependency versions
run: pwd && echo "${{ github.workspace }}"