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

$GITHUB_STEP_SUMMARY isn't documented #18

Open
jsoref opened this issue Apr 4, 2024 · 2 comments · May be fixed by #36
Open

$GITHUB_STEP_SUMMARY isn't documented #18

jsoref opened this issue Apr 4, 2024 · 2 comments · May be fixed by #36

Comments

@jsoref
Copy link

jsoref commented Apr 4, 2024

nektos/act#1607 added some support for $GITHUB_STEP_SUMMARY

There is no documentation https://nektosact.com/?search=github_step_summary

Note that you can no longer use --env GITHUB_STEP_SUMMARY=/dev/stdout -- that's fine, although it'd be nice if there was a warning (this is out of scope).

The best I've found to access step summaries is:

act -r
while true; do
  act_docker_pid=$(docker ps|perl -ne 'next unless s{\s.*"tail -f /dev/null".*act-.*}{};print'|tail -1)
  if [ -z "$act_docker_pid" ]; then
    break
  fi
  echo "$(docker ps|grep ^$act_docker_pid)::"
  docker exec $act_docker_pid cat /var/run/act/workflow/SUMMARY.md
  echo
  docker rm -f $act_docker_pid > /dev/null
done

act -r means that the container is kept around
GITHUB_STEP_SUMMARY is generally defined as /var/run/act/workflow/SUMMARY.md

Note that each job is run in its own docker container so the files are independent.

(This isn't remotely ideal, but some documentation is better than nothing.)


It also should note that content written to $GITHUB_STEP_SUMMARY will be destroyed at the beginning of the next step, so anyone running a multistep workflow in ACT should not rely on it as the output from any step other than the last will not be accessible.

nektos/act#2273

@stephanschielke
Copy link

Thanks for your research on this. This workaround helped me.

It looks like the path to SUMMARY.md is hardcoded here.

So are all the other files:

docker exec <running_act_container_id> ls -al /var/run/act/workflow
...
-rw-rw-rw- 1 root root    0 Jan  1  1970 SUMMARY.md
-rw-rw-rw- 1 root root    0 Jan  1  1970 envs.txt
-rw-r--r-- 1 root root    2 Jan  1  1970 event.json
-rw-rw-rw- 1 root root    0 Jan  1  1970 outputcmd.txt
-rw-rw-rw- 1 root root    0 Jan  1  1970 pathcmd.txt
-rw-rw-rw- 1 root root    0 Jan  1  1970 statecmd.txt

Also, there seems to be some very funky stuff going on with the GITHUB_STEP_SUMMARY env vars here
coming from here
but actually stemming from another repo and codebase here

The only real solution IMHO is a dedicated feature as outlined (by you) here

@ChristopherHX
Copy link
Contributor

That this feature is absent is actually documented here: https://nektosact.com/not_supported.html#planned, but not using the env variable as name so search after that one has no result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants