runner/act/runner/testdata/shells/node/push.yml
Earl Warren c1892b6398 fix!: fallback to sh if bash does not exist
It is a breaking change because it changes how the shell is
determined.

Before, if `jobs.<job_id>.container.image` is set and the shell is not
specified, it defaults to `sh` instead of `bash`.

After, regardless of `jobs.<job_id>.container.image`, if the shell is
not specified, it defaults to `bash` if available, otherwise it
defaults to `sh`.

Rework the shell integration tests:

- Remove container specific tests because the special behavior related
  to shell being set differently when a container image is present is
  removed
- Modify the defaults test case to verify the fallback logic
- Use container images from code.forgejo.org to escape rate limiting
  in the CI
- Add the missing node test
- Use
      container:
        image: code.forgejo.org/oci/node:22-bookworm
  instead of
      container: code.forgejo.org/oci/node:22-bookworm
  because it silently failed to run (with no exit code)
- Prefer `-z "${BASH}"` because `-z ${BASH+x}` reads obscure

Closes forgejo/runner#150
2025-07-12 19:01:14 +02:00

18 lines
346 B
YAML

on: push
env:
MY_SHELL: node
jobs:
check:
runs-on: ubuntu-latest
steps:
- shell: ${{ env.MY_SHELL }}
run: |
console.log(process.version)
check-job-default:
runs-on: ubuntu-latest
defaults:
run:
shell: ${{ env.MY_SHELL }}
steps:
- run: |
console.log(process.version)