diff --git a/docs/advanced/github_actions.md b/docs/advanced/github_actions.md index 395cb8203..2fca1d26d 100644 --- a/docs/advanced/github_actions.md +++ b/docs/advanced/github_actions.md @@ -235,6 +235,29 @@ If you want to use PowerShell, you need to specify `-Command` as well. There are some custom shells provided by GitHub that have slightly different behavior, see [`jobs..steps[*].shell`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell) in the documentation. See the [official documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#custom-shell) and [ADR 0277](https://github.com/actions/runner/blob/main/docs/adrs/0277-run-action-shell-options.md) for more information about how the `shell:` input works in GitHub Actions. +#### One-off shell wrapper using `pixi exec` + +With `pixi exec`, you can also run a one-off command inside a temporary pixi environment. + +```yaml +- run: | # (1)! + zstd --version + shell: pixi exec --spec zstd -- bash -e {0} +``` + +1. everything here will be run inside of the temporary pixi environment + +```yaml +- run: | # (1)! + import ruamel.yaml + # ... + shell: pixi exec --spec python=3.11.* --spec ruamel.yaml -- python {0} +``` + +1. everything here will be run inside of the temporary pixi environment + +See [here](../reference/cli.md#exec) for more information about `pixi exec`. + ### Environment activation Instead of using a custom shell wrapper, you can also make all pixi-installed binaries available to subsequent steps by "activating" the installed environment in the currently running job. diff --git a/docs/advanced/updates_github_actions.md b/docs/advanced/updates_github_actions.md index c76e5ec01..4073180e3 100644 --- a/docs/advanced/updates_github_actions.md +++ b/docs/advanced/updates_github_actions.md @@ -41,8 +41,8 @@ jobs: run-install: false - name: Update lockfiles run: | - pixi global install pixi-diff-to-markdown - pixi update --json --no-install | pixi-diff-to-markdown >> diff.md + set -o pipefail + pixi update --json --no-install | pixi exec pixi-diff-to-markdown >> diff.md - name: Create pull request uses: peter-evans/create-pull-request@v6 with: diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 5a9168a00..f47f2957c 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -94,7 +94,7 @@ pixi add --feature featurex numpy ``` !!! tip - If you want to use a non default pinning strategy, you can set it using [pixi's configuration](reference/pixi_configuration#pinning-strategy). + If you want to use a non default pinning strategy, you can set it using [pixi's configuration](./pixi_configuration.md#pinning-strategy). ``` pixi config set pinning-strategy no-pin --global ```