summaryrefslogtreecommitdiffstats
path: root/pkg/runner/testdata/container-hostname/push.yml
blob: 2235a7bb1e1af1d7310610dbdd2bf8448966009f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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 --user 100:101"
    steps:
      - run: |
          echo "UID: $(id -u)"
          echo "GID: $(id -g)"
          echo "HOST: $(uname -n)"
          [[ "$(id -u)" == "100" ]] && [[ "$(id -g)" == "101" ]] && [[ "$(uname -n)" == "my.host.local" ]]

  default-hostname:
    runs-on: ubuntu-latest
    container:
      image: node:16-buster-slim
    steps:
      - run: |
          echo "UID: $(id -u)"
          echo "GID: $(id -g)"
          echo "HOST: $(uname -n)"
          [[ "$(id -u)" == "0" ]] && [[ "$(id -g)" == "0" ]] && [[ $(uname -n) ]] && [[ "$(uname -n)" != "my.host.local" ]]