Skip to content

Commit b561086

Browse files
vlad-uipathclaude
andcommitted
fix(uipath-solution): install the pinned CLI in the CI example
In a repo that commits a frozen .uipath/config.json, `npm install -g @uipath/cli` installs the newest CLI, which is off the CLI pin, so `uip login` and every later step are refused. Install versions.cli, run `uip update` and check for the `frozen at` line. Without a freeze, install one exact version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0100a33 commit b561086

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎skills/uipath-solution/references/pack-and-deploy.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,24 @@ jobs:
453453
runs-on: ubuntu-latest
454454
steps:
455455
- uses: actions/checkout@v4
456-
- run: npm install -g @uipath/cli
456+
- shell: bash # the [[ =~ ]] check needs bash
457+
run: | # install the CLI the repo's freeze pins; fails the job when the file is missing or versions.cli is not an exact version
458+
CLI_PIN=$(node -p "require('./.uipath/config.json').versions.cli")
459+
[[ "$CLI_PIN" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] || { echo "versions.cli in .uipath/config.json is not an exact version" >&2; exit 1; }
460+
npm install -g "@uipath/cli@$CLI_PIN"
461+
- run: uip --version 2>&1 | grep "frozen at" # fails when the pinned CLI is too old to read the freeze
462+
- run: uip update # puts each pinned tool on its pin; exits 1 when the CLI or a pinned tool stays off its pin
457463
- run: uip login --client-id "${{ secrets.UIPATH_CLIENT_ID }}" --client-secret "${{ secrets.UIPATH_CLIENT_SECRET }}" --tenant "${{ secrets.UIPATH_TENANT }}" --output json
458464
- run: uip solution restore ./MySolution --output json # optional: fail fast on a missing feed before pack
459465
- run: uip solution pack ./MySolution ./output --version "1.0.${{ github.run_number }}" --output json
460466
- run: uip solution publish ./output/MySolution_*.zip --output json
461467
- run: uip solution deploy run -n "MySolution-${{ github.run_number }}" --package-name "MySolution" --package-version "1.0.${{ github.run_number }}" --folder-name "MySolution" --config-file deploy-config.json --output json
462468
```
463469
470+
This job expects the repo to commit a frozen `.uipath/config.json`, so every run uses the same CLI and tools. Make the freeze once on a dev machine, inside the repo: `npm install -g @uipath/cli@<CLI_VERSION>`; if the repo has no `.uipath/config.json` yet, create an empty one (`mkdir -p .uipath && touch .uipath/config.json`) so the freeze goes to the repo and not to your home config; then install only the tools the job needs with `UIPATH_CLI_DISABLE_VERSION_SYNC=1 uip tools install <TOOL>` (here `solution`, plus the tool of each project type in the solution) and run `uip config freeze`; then commit `.uipath/config.json`. `uip config freeze --all` also works, but it pins every tool, and `uip update` then installs all of them on every run. Read the file before you commit it: everything in it goes into the repo. In a frozen repo, do **not** install the newest CLI (`npm install -g @uipath/cli` or `@latest`; `npm`'s `latest` tag for `@uipath/cli` can be a dev build): it is off the CLI pin, and every command except `uip update` and `uip config` is refused until the CLI is back on its pin. Do not run `uip update --force` to get past a refusal: it updates past the freeze and rewrites the pins in `.uipath/config.json`. `uip update` installs no skills on a runner that has none, and this job needs none. One runner holds one freeze at a time: on a self-hosted runner, two jobs with other pins move the same global install. For details, run `uip config freeze --help` and `uip update --help`.
471+
472+
With no freeze in the repo, replace the three steps after checkout with one step: `npm install -g @uipath/cli@<CLI_VERSION>`, an exact version you chose.
473+
464474
---
465475

466476
## Environment Promotion

‎tests/scripts/studioweb-browser-commands.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,26 @@
716716
"file": "references/develop-solution.md",
717717
"command": "login tenant set",
718718
"reason": "Prose: explains that switching tenants does not change which Studio Web solution an upload overwrites, not an instruction to run it."
719+
},
720+
{
721+
"file": "references/pack-and-deploy.md",
722+
"command": "config",
723+
"reason": "The GitHub Actions example and its freeze note describe a CI runner with the npm-installed CLI, not the Studio Web host, so the text is right as is for a Studio Web user who sets up CI."
724+
},
725+
{
726+
"file": "references/pack-and-deploy.md",
727+
"command": "config freeze",
728+
"reason": "The GitHub Actions example and its freeze note describe a CI runner with the npm-installed CLI, not the Studio Web host, so the text is right as is for a Studio Web user who sets up CI."
729+
},
730+
{
731+
"file": "references/pack-and-deploy.md",
732+
"command": "tools install",
733+
"reason": "The GitHub Actions example and its freeze note describe a CI runner with the npm-installed CLI, not the Studio Web host, so the text is right as is for a Studio Web user who sets up CI."
734+
},
735+
{
736+
"file": "references/pack-and-deploy.md",
737+
"command": "update",
738+
"reason": "The GitHub Actions example and its freeze note describe a CI runner with the npm-installed CLI, not the Studio Web host, so the text is right as is for a Studio Web user who sets up CI."
719739
}
720740
],
721741
"ceiling": {

0 commit comments

Comments
 (0)