nektos / act

Run your GitHub Actions locally 🚀
https://nektosact.com
MIT License
51.9k stars 1.31k forks source link

$RUNNER_OS and "${{ runner.os }}" case differs from Github Actions #1990

Open virzak opened 10 months ago

virzak commented 10 months ago

Bug report info

act version:            0.2.49
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        \\.\pipe\docker_engine(broken)
Config files:
Build info:
        Go version:            go1.20.6
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.49 -X main.commit=d5d854854651c151ecd914bb6e2e370e0057929a -X main.date=2023-08-01T02:21:56Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         d5d854854651c151ecd914bb6e2e370e0057929a
                vcs.time:             2023-08-01T02:21:38Z
                vcs.modified:         false
Docker Engine:
        Engine version:        24.0.5
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.90.4-microsoft-standard-WSL2
        OS CPU:                16
        OS memory:             15696 MB
        Security options:
                name=seccomp,profile=unconfined

Command used with act

act -P windows-latest=-self-hosted

Describe issue

Expect Windows where W is capitalized, which is the output from Github Actions. Getting all lowered case letters.

Link to GitHub repository

No response

Workflow content

name: Build

on:
  push:

jobs:

  build:

    runs-on: windows-latest
    defaults:
      run:
        shell: bash

    steps:
    - name: Set path for nektos/act
      if: ${{ runner.os  == 'Windows' && env.ACT }}
      run: echo "C:\Program Files\Git\bin" >> $GITHUB_PATH
      shell: '"C:\Program Files\Git\bin\bash.exe" -c {0}'

    - name: 'Determine prerequisites'
      id: prereq
      run: |
        echo "$RUNNER_OS" "${{ runner.os }}"

Relevant log output

🚀  act -P windows-latest=-self-hosted
[Build/build] ⭐ Run Main Set path for nektos/act
[Build/build]   ✅  Success - Main Set path for nektos/act
[Build/build]   ⚙  ::add-path:: C:\Program Files\Git\bin
[Build/build] ⭐ Run Main Determine prerequisites
| windows windows
[Build/build]   ✅  Success - Main Determine prerequisites
[Build/build] 🏁  Job succeeded

Additional information

No response

github-actions[bot] commented 4 months ago

Issue is stale and will be closed in 14 days unless there is new activity

virzak commented 4 months ago

bump