Open a PR with updated dependencies #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }}" |