name: container-hostname on: push defaults: run: shell: bash jobs: with-hostname: runs-on: ubuntu-latest container: image: node:16-buster-slim options: "--hostname my.host.local" steps: - run: | [[ $(uname -n) == "my.host.local" ]] default-hostname: runs-on: ubuntu-latest container: image: node:16-buster-slim steps: - run: | [[ $(uname -n) ]] && [[ $(uname -n) != "my.host.local" ]]