Skip to content

Open a PR with updated dependencies #9

Open a PR with updated dependencies

Open a PR with updated dependencies #9

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 }}"