Commit Graph

394 Commits

Author SHA1 Message Date
ChristopherHX
7c7b383c10 fix: post step failure is job failure (#5297)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-06-13 16:53:18 +00:00
ChristopherHX
4ba1c2bde6 feat: --validate and --strict (#2717)
* feat: `--validate` and `--strict`

* fix missing changes

* add test for strict validate

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-06-11 22:02:16 +00:00
ChristopherHX
d8506bfa4f fix: valueMasker concurrent map write (#5026)
* valueMasker create secrets copy

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-06-11 18:06:25 +00:00
ChristopherHX
67e332e838 fix: GITHUB_ENV and GITHUB_OUTPUT allow larger lines (#5028) 2025-06-11 17:36:11 +00:00
ChristopherHX
1154f0d984 feat: log parsed commands and step summary (#2761)
* feat: log parsed command data in json logger

* Could be used to upload the GITHUB_STEP_SUMMARY by downstream Projects
* You can see the summary and other commands
* Access the raw line of most commands

* Update step.go

* Update step.go

* Update push.yml

* .

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-06-01 21:30:40 +00:00
Josh Soref
a8ac529344 fix: wrap subpath in '' (#2754) (#2755)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Jakub Panek <me@panekj.dev>
2025-05-23 08:46:05 +00:00
Bengt Brodersen
16b86a64a9 feat: add cli option to set concurrent jobs count (#2762)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-05-23 08:05:42 +00:00
Josh Soref
b5469ac4ca fix: add missing punctuation to error report (#2752) (#2753)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-05-23 06:42:27 +00:00
ChristopherHX
8a18fb08ad chore(ci): disable invalid test case (#2875)
* chore(ci): disable invalid test case

* GitHub Hosted Runners `sh` no longer identifies itself as `bash`

* fix indent
2025-05-22 20:53:07 +00:00
ChristopherHX
bea04dd8f9 feat: Support graceful job step cancellation (#2714)
* feat: Support graceful job step cancellation

* for gh-act-runner
* act-cli support as well
* respecting always() and cancelled() of steps

* change main

* cancel startContainer / gh cli / bugreport early

* add to watch as well

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-03-29 17:00:37 +00:00
ChristopherHX
517c3ac467 fix: reporting fetch failure as job error and log the error (#2715)
E.g. if GoGitAction Cache had a fetch failure this error did not trigger report jobResult Failure.

Also the error has been not printed until the last message before exit of act.

* adds tests for both corner cases
2025-03-29 16:41:42 +00:00
Paolo Tagliaferri
0098044d76 Report the elapsed time for each workflow step (#2700)
* Report the elapsed time for each workflow step

The `runStepExecutor` was extended to track and report the execution time of the step.

This applies both to the standard and JSON log format.

Please, note that:
- on the standard log the time format depends on the value (e.g. `3.038334954s` or `2m0.054014069s`)
- on the JSON log the time format is nanoseconds

* Added the `executionTime` report also to failing steps
2025-03-18 12:51:53 +00:00
ChristopherHX
95e411da06 fix: remote docker actions new action cache and dry run mode (#2513)
* fixes

* Add TestDockerCopyTarStreamDryRun

* increase coverage a bit

* fixup

* fixup

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-02-25 02:28:17 +00:00
ChristopherHX
16bdce5f1f feat: GoGitActionCache shallow fetch (#2677)
* speed up cloning iff feature flag is on, should not have any negative impact
2025-02-22 14:29:03 +00:00
Steven Edwards
51147d452a Incorporate Debug, Warn, Error logging. (#2490) 2025-02-08 11:19:05 -08:00
ChristopherHX
60a499da93 refactor logger (#2552) 2025-02-08 11:18:08 -08:00
ChristopherHX
be51601734 parse_env_file discard utf8 bom (#2638)
* parse_env_file discard utf8 bom

* powershell 5 may add the BOM even when explicitly using utf8

* add test + apply to GITHUB_PATH as well

* fix it

* fix powershel 5 syntax

* misc

* fixup

* fix wrong subaction

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-02-01 18:17:25 +00:00
S. M. Mahmudul Haque (Yamin)
deea8ec8c6 fix: prevent unintended input replacement in reusable workflows with workflow_dispatch when using workflow_call (#2502)
* Remove redundant check

See: https://github.com/nektos/act/issues/2464#issuecomment-2430903650

* Add condition to prevent replacing inputs in reusable workflows with workflow_dispatch inputs

Closes: https://github.com/nektos/act/issues/2464

* fmt

* Revert "Remove redundant check"

This reverts commit 63455960ec714eea7631a586bcd59bed449739fc.

* add test

* Update runner_test.go

* update label

---------

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2024-12-29 14:52:06 +00:00
Casey Lee
7172fc31d1 chore: upgrade dependencies (#2589)
* chore: upgrade dependencies

* fix: linter errors

* chore: bump version of golangci-lint

* chore: go mod tidy

* fix: failing test

* fix: update version of upload-artifact to v4

* chore: format test output with gotestfmt

* fix: typo in test exec

* fix: failing tests

* fix: windows unit test execution

* fix: windows unit test execution

* fix: whitespace
2024-12-24 13:12:24 -08:00
ChristopherHX
2c0e3fea00 fix: tests with validation errors were skipped (#2496)
* fix: tests with validation errors were skipped

* fixup

* [no ci] fix one test

* fix some tests

* fix last test

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-10-28 04:03:42 +00:00
ChristopherHX
9142ed9bf7 feat: improve new action cache logging (#2474)
* feat: improve new action cache logging

* Test logging failure cases

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-10-10 03:07:55 +00:00
ChristopherHX
5ffec84f8d fix: if condition in composite action misbehaves (#2473)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-10-10 02:52:09 +00:00
Ryan
a34d9c6d60 run_context: add GITHUB_RUN_ATTEMPT (#2458)
* run_context: add GITHUB_RUN_ATTEMPT

Fixes https://github.com/nektos/act/issues/2451
Fixes https://github.com/nektos/act/issues/1615

* fix whitespace

* fix githubcontext

* fix TestSetupEnv

---------

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-09-19 21:36:09 +00:00
sebastien-perpignane
2e117a4d2b bug/issue #2448 - manage special bash options when no shell is defined (#2449)
* bash without "-o pipefail" option when "bash" is not explicitely
defined in the workflow
* bonus: fix inverted expected and actual in TestGetGitHubContext assertions
2024-09-19 08:28:45 +00:00
ChristopherHX
102e6cbce0 feat: Validate GitHub Actions schema (#2416)
* feat: Validate GitHub Actions schema

**BREAKING** previously accepted workflows are now invalid

* update code

* fix tests

* Bump docker / fix lint

* fix test action due to moving the file

* remove unused function

* fix parsing additional functions

* fix allow int

* update docker dep, due to linter
2024-08-13 03:40:21 +00:00
Andrii Chyrva
570ccf390e Fix #2363. Add /pre- and /post-entrypoint handling (#2394)
* Fix #2363. Add /pre- and /post-entrypoint handling

* fix copy paste error

---------

Co-authored-by: Andrii Chyrva <achyrva@hotmail.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2024-07-24 07:41:33 +00:00
ChristopherHX
6de25a53bc fix: make node tool non volatile (#2372)
* fix: make node tool non volatile

Currently downgrading node via setup-node can break later actions

* fix it and lookup on startup

* fix problems

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-07-10 15:58:37 +00:00
ChristopherHX
2ad5ff74f8 fix: add missing service container health check (#2354)
* fix: Implement missing health ceck for Services

* Add test case

* linter doesn't support min builtin and fix check

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-07-10 15:33:54 +00:00
Louis Auzuret
e4607fc791 fix: skip service container for empty image (#2281)
* fix: skip service container for empty image

It is used to skip empty image name in services which is the only way to handle condition services in github action currently https://github.com/actions/runner/issues/822

* test: add testdata for empty image in services

* fix: add missing test call

* fix: wring test call

* fix: invalid without expression

---------

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2024-06-05 19:16:34 +00:00
ChristopherHX
b5ad3c4acd fix: composite action input pollution (#2348)
* fix: composite action input pollution

* fix run steps

* fix missing defaults in post after env cleanup

* fix test to make more sense

* Add tests and simplify change

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-06-05 14:44:44 +00:00
ChristopherHX
b917ecc184 fix: update reusable workflow input handling (#2349)
* update reusable workflow input handling

* make test stricter

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-06-05 14:30:12 +00:00
ChristopherHX
4977ba910c Meta-copy-symlinks-new-actions-cache (#2337)
* meta: copy symlinks

* copy file (old style)

* copy files (new styles)

* avoid spelling error detection

* add error

* fix

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-05-29 00:12:32 +00:00
ChristopherHX
e1e5671e3d Actions Artifacts v4 backend (#2224)
* Actions Artifacts v4 backend

* lint

* fix it now

* remove protofile, to make linter not complain

* sync changes

* add delete

* import auth test from gitea

* add more tests

* codecov ignore protobuf
2024-05-20 20:00:04 +00:00
Yaroslav Halchenko
843cd94cc2 Add codespell support (config, workflow to detect/not fix) and make it fix few typos (#2296)
* Add github action to codespell master on push and PRs

* Add codespell config with few custom skips

* [DATALAD RUNCMD] Do interactive fixing of  leftover ambigous typos

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2 ./pkg/common/git/git.go",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* exclude pkg/runner/hashfiles/index.js

* [DATALAD RUNCMD] run codespell throughout fixing typos automagically

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-04-19 09:22:45 +00:00
ChristopherHX
5a9dd3d0ea fix: skipped jobs have no result (#2276)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-04-11 02:31:18 +00:00
lvyaoting
ac13a1b20d chore: fix some comments (#2279)
Signed-off-by: lvyaoting <lvyaoting@outlook.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2024-04-10 19:58:56 +00:00
James Kang
3949d74af5 chore: remove repetitive words (#2259)
Signed-off-by: majorteach <csgcgl@126.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2024-03-28 23:14:53 +00:00
Jason Song
f56dd65ff6 test: use ping to improve network test (#2266) 2024-03-28 11:56:26 +00:00
huajin tong
352ad41ad2 fix function name in comment (#2240)
Signed-off-by: thirdkeyword <fliterdashen@gmail.com>
2024-03-06 14:20:06 +00:00
ChristopherHX
ac6a465e27 feat: Test writing remote Actions locally (#2155)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-02-23 07:40:14 +00:00
ChristopherHX
5601fb0e13 refactor: simpilfy go-git cache (#2208) 2024-02-18 03:53:22 +00:00
ChristopherHX
852959e1e1 feat: offline mode for new action cache (#2173)
* Try fetch update of the action, otherwise use cached version

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-02-12 12:51:37 +00:00
Markus Wolf
054caec791 fix: use correct path to toolcache (#1494)
The toolcache on GitHub Actions need to be in
/opt/hostedtoolcache. This is the case for all
environment variables set by act, but it's not the
case for the volume mounted into the container.

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-30 22:43:52 +00:00
ChristopherHX
6dd67253bc fix: improve new-action-cache fetch failure error (#2172)
- include repoURL and repoRef in error
- map NoErrAlreadyUptodate to `couldn't find remote ref` for branchOrtag
  fetch request

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-28 17:02:15 +00:00
ChristopherHX
09d4b5d6ad fix: subpath actions via new artifact cache (#2170)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-28 16:49:47 +00:00
ChristopherHX
a6ec2c129a fix: improve action not found error (#2171) 2024-01-28 16:37:19 +00:00
TKaxv_7S
f055d4ae60 feat: support offline mode (#2128)
* Add: Actions Offline Mode

* Add: Actions Offline Mode

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-20 00:20:15 +00:00
ChristopherHX
f7a846d2f5 feat: cli option to enable the new action cache (#1954)
* Enable the new action cache

* fix

* fix: CopyTarStream (Docker)

* suppress panic in test

* add a cli option for opt in

* fixups

* add package

* fix

* rc.Config nil in test???

* add feature flag

* patch

* Fix respect --action-cache-path

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* add remote reusable workflow to ActionCache

* fixup

---------

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-19 23:49:35 +00:00
Jon Jensen
00fbfa754c Fix noisy runs-on error logging (#2102)
Move the logging back up a level to fix a minor logging issue introduced in #2088

`RunContext`s for composite actions have dummy/blank `Job`s with no `runs-on`,
meaning their calls to `withGithubEnv` would result in an inaccurate log message
complaining that `'runs-on' key not defined in ...`

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-12-16 23:04:54 +00:00
Jon Jensen
55477899e7 Evaluate if condition when calling a reusable workflow (#2087)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2023-11-12 20:01:32 +00:00