Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action repository not triggering export-subst (can't run psf/black action) #1767

Closed
ggoretkin-bdai opened this issue Apr 25, 2023 · 4 comments
Labels
kind/bug Something isn't working stale

Comments

@ggoretkin-bdai
Copy link

Bug report info

$ gh act --bug-report
act version:            0.2.44
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/ggoretkin/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.18.10
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-compiler:            gc
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         65088b8f28d44da128b95ec194a04277b8856be9
		vcs.time:             2023-01-20T18:39:07Z
		vcs.modified:         true
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 22.04.2 LTS
	OS type:               linux
	OS version:            22.04
	OS arch:               x86_64
	OS kernel:             5.19.0-40-generic
	OS CPU:                16
	OS memory:             15699 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default
		name=cgroupns

Command used with act

gh act -W .github/workflows/black.yaml

Describe issue

The workflow completes on github.com, so I expect it to work the same on my local system. It seems that when GHA checks out the action, it will populate https://github.com/psf/black/blob/de65741b8d49d78fa2675ef79b799cd35e92e7c1/.git_archival.txt with values. A git clone gives

node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$

but downloading a release gives:

node: bf7a16254ec96b084a6caf3d435ec18f0f245cc7
node-date: 2023-03-28T17:53:23-07:00
describe-name: 23.3.0
ref-names: tag: 23.3.0, stable

See psf/black#3543

Link to GitHub repository

No response

Workflow content

name: Black

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: psf/black@stable

Relevant log output

$ gh act -W .github/workflows/black.yaml 
[Black/lint] 🚀  Start image=catthehacker/ubuntu:full-latest
[Black/lint]   🐳  docker pull image=catthehacker/ubuntu:full-latest platform= username= forcePull=true
[Black/lint]   🐳  docker create image=catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Black/lint]   🐳  docker run image=catthehacker/ubuntu:full-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Black/lint]   ☁  git clone 'https://github.com/psf/black' # ref=stable
[Black/lint] ⭐ Run Pre psf/black@stable
[Black/lint]   ✅  Success - Pre psf/black@stable
[Black/lint] ⭐ Run Main actions/checkout@v3
[Black/lint]   🐳  docker cp src=/home/ggoretkin/repos/gh-act-black/. dst=/home/ggoretkin/repos/gh-act-black
[Black/lint]   ✅  Success - Main actions/checkout@v3
[Black/lint] ⭐ Run Main psf/black@stable
[Black/lint]   🐳  docker cp src=/home/ggoretkin/.cache/act/psf-black@stable/ dst=/var/run/act/actions/psf-black@stable/
[Black/lint] ⭐ Run Main if [ "$RUNNER_OS" == "Windows" ]; then
  python $GITHUB_ACTION_PATH/action/main.py
else
  python3 $GITHUB_ACTION_PATH/action/main.py
fi
[Black/lint]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0.sh] user= workdir=
| Installing black[colorama]==$Format:%(describe:tags=true,match=*[0-9]*)$...
| ERROR: Invalid requirement: 'black[colorama]==$Format:%(describe:tags=true,match=*[0-9]*)$'
| 
[Black/lint]   ❗  ::error::Failed to install Black.
[Black/lint]   ❌  Failure - Main if [ "$RUNNER_OS" == "Windows" ]; then
  python $GITHUB_ACTION_PATH/action/main.py
else
  python3 $GITHUB_ACTION_PATH/action/main.py
fi
[Black/lint] exitcode '1': failure
[Black/lint]   ❌  Failure - Main psf/black@stable
[Black/lint] exitcode '1': failure
[Black/lint] ⭐ Run Post psf/black@stable
[Black/lint]   🐳  docker cp src=/home/ggoretkin/.cache/act/psf-black@stable/ dst=/var/run/act/actions/psf-black@stable/
[Black/lint]   ✅  Success - Post psf/black@stable
[Black/lint] 🏁  Job failed
Error: Job 'lint' failed

Additional information

No response

@ggoretkin-bdai ggoretkin-bdai added the kind/bug Something isn't working label Apr 25, 2023
@endrebak
Copy link

I can reproduce. I guess you could just do

  black:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python environment
        uses: actions/setup-python@v4
        with:
          python-version: "3.11.0"
          max-line-length: "120"
      - run: pip install black
      - run: black --check --diff .

for now

@ggoretkin-bdai
Copy link
Author

I have forgotten what "triggering export-subst" means, if you can remind me.

@alex-savchuk
Copy link
Contributor

From my point of view, it's ok to do not process export-subst attribute for "git clone" command.
In docu https://www.git-scm.com/docs/gitattributes it's processed by "git archive" command only.
So it's interesting if GHA checkout performs a processing of such attribute for cloning...

Copy link
Contributor

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

@github-actions github-actions bot added the stale label Mar 31, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants