nektos / act

Run your GitHub Actions locally 🚀

Home Page:https://nektosact.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can't change default image on Ubuntu Start image=node:16-buster-slim

yucelz opened this issue · comments

Bug report info

act --bug-report
act version:            0.2.60
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
Config files:           
        /home/{user_name}/.config/act/actrc:
                -P ubuntu-latest=node:16-buster-slim
                -P ubuntu-22.04=node:16-bullseye-slim
                -P ubuntu-20.04=node:16-buster-slim
                -P ubuntu-18.04=node:16-buster-slim
Build info:
        Go version:            go1.20.14
        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.60 -X main.commit=d3c8664d3d6acb855ae5418f6d02930c98bf877e -X main.date=2024-03-01T02:13:23Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         d3c8664d3d6acb855ae5418f6d02930c98bf877e
                vcs.time:             2024-03-01T02:12:58Z
                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:                    Ubuntu Core 22
        OS type:               linux
        OS version:            22
        OS arch:               x86_64
        OS kernel:             5.15.0-101-generic
        OS CPU:                12
        OS memory:             15818 MB
        Security options:
                name=apparmor
                name=seccomp,profile=builtin

Command used with act

act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04

Describe issue

I was trying to change the default image set based on my first workflow attempt but couldn't do it. as a quick solution, I deleted everything under /home/{user_name}/.config/act/actrc

Link to GitHub repository

No response

Workflow content

name: Pre-commit

on:
  pull_request:
  push:
    branches: [main]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: '3.11'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install pre-commit
    - name: Run pre-commit
      run: python src/test.py

Relevant log output

-

Additional information

No response

Yes you can't change runs-on: ubuntu-latest with a -P ubuntu-18.04=... cli argument. This will only change the image for runs-on: ubuntu-18.04.

I don't think it is a bug to demand you to type -P ubuntu-latest=... in your example