Commit Graph
121 Commits
Author SHA1 Message Date
Christopher HombergerandLunny Xiao 3a07d231a0 Fix yaml with prefixed newline broken setjob + yaml v4 (#144)
* go-yaml v3 **and** v4 workaround
* avoid yaml.Marshal broken indention

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/act/pulls/144
Reviewed-by: wxiaoguang <[email protected]>
Reviewed-by: Zettat123 <[email protected]>
Co-authored-by: Christopher Homberger <[email protected]>
Co-committed-by: Christopher Homberger <[email protected]>
2025-12-09 02:28:56 +00:00
Zettat123andLunny Xiao f56fd693ee Add run_attempt to context (#126)
Fix https://github.com/go-gitea/gitea/issues/33135

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/act/pulls/126
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2025-11-14 20:14:23 +00:00
Christopher HombergerandChristopherHX 91852faf93 refactor: simplify adding new node versions add node 24 (#140)
* backport

Reviewed-on: https://gitea.com/gitea/act/pulls/140
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Christopher Homberger <[email protected]>
Co-committed-by: Christopher Homberger <[email protected]>
2025-08-21 16:04:08 +00:00
ChristopherHXandChristopherHX 39509e9ad0 Support Simplified Concurrency (#139)
- update RawConcurrency struct to parse and serialize string-based concurrency notation
- update EvaluateConcurrency to handle new RawConcurrency format

Reviewed-on: https://gitea.com/gitea/act/pulls/139
Reviewed-by: Zettat123 <[email protected]>
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
Co-committed-by: ChristopherHX <[email protected]>
2025-07-29 09:14:47 +00:00
65c232c4a5 Parse permissions (#133)
Resurrecting [this PR](https://gitea.com/gitea/act/pulls/73) as the original author has [lost motivation](https://github.com/go-gitea/gitea/pull/25664#issuecomment-2737099259) (though, to be clear - all credit belongs to them, all mistakes are mine and mine alone!)

Co-authored-by: Søren L. Hansen <[email protected]>
Reviewed-on: https://gitea.com/gitea/act/pulls/133
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Jack Jackson <[email protected]>
Co-committed-by: Jack Jackson <[email protected]>
2025-03-24 18:17:06 +00:00
Zettat123andLunny Xiao ec091ad269 Support concurrency (#124)
To support `concurrency` syntax for Gitea Actions

Gitea PR: https://github.com/go-gitea/gitea/pull/32751

Reviewed-on: https://gitea.com/gitea/act/pulls/124
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2025-02-11 02:51:48 +00:00
Jason Song 38e7e9e939 Use hashed uses string as cache dir name (#117)
Reviewed-on: https://gitea.com/gitea/act/pulls/117
Reviewed-by: Lunny Xiao <[email protected]>
2024-09-24 06:53:41 +00:00
Jason Song 3fa1dba92b Merge tag 'nektos/v0.2.61' 2024-04-01 14:23:16 +08:00
Jason Song 79a7577c15 Merge tag 'nektos/v0.2.60' 2024-03-25 16:58:11 +08:00
huajin tongandGitHub 352ad41ad2 fix function name in comment (#2240)
Signed-off-by: thirdkeyword <[email protected]>
2024-03-06 14:20:06 +00:00
Josh SorefGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
5e0d29d665 fix: improve warning about remote not found (#2169)
Signed-off-by: Josh Soref <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-28 19:21:21 +00:00
胖梁GitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
8072a00a77 WorkflowDispatchConfig supports multiple yaml node kinds (#2123)
* WorkflowDispatchConfig supports ScalarNode and SequenceNode yaml node kinds

* Avoid using log.Fatal

* package slices is not in golang 1.20

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-20 14:07:36 +00:00
ChristopherHXGitHubBjörn Brauermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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 <[email protected]>

* add remote reusable workflow to ActionCache

* fixup

---------

Co-authored-by: Björn Brauer <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-19 23:49:35 +00:00
04011b6b78 feat: support runs-on labels and group (#2062)
Signed-off-by: Raffael Sahli <[email protected]>
Co-authored-by: ChristopherHX <[email protected]>
2023-11-12 19:46:38 +00:00
techknowlogick 4699c3b689 Merge nektos/act/v0.2.51 2023-09-24 15:09:26 -04:00
Oliver BellandGitHub 935e37c25b feat: support node20 runtime (#1988)
* feat: support node20

* fix

* more fixes

* maybe final fixes?

* format
2023-09-15 02:24:46 +00:00
Nathan ShaabanandGitHub 7286b43b0e fix: fail if no stages were found (#1970)
* fix: fail if no stages were found

Adds a warning message if act is cannot find any stages to run
with the filters provided.

Reproduction:
- run `act -j gibberish`

Desired behavior: some indication I did something silly
Actual behavior: no output, just exit with success.

As a human who often makes spelling mistakes,
it would be nice if act warned me what I was doing that was silly
rather than exiting apparently doing
nothing with no obvious indication
I did something wrong.

* Revert "fix: fail if no stages were found"

This reverts commit 226adf1c15cf4c01d516a05dc923507e6999978d.

* fix: fail if no stages were found

Errors if no stages were found with the given filters.
Prints out a helpful error message, pointing users
in the right place for how to specify which stage to run.

Reproduction:
- run `act -j gibberish`

Desired behavior: some indication I did something silly
Actual behavior: no output, just exit with success.

As a human who often makes spelling mistakes,
it would be nice if act warned me what I was doing that was silly
rather than exiting apparently doing
nothing with no obvious indication
I did something wrong.
2023-08-21 17:53:47 +00:00
ChristopherHXGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
83140951bf feat: cmd support for windows (#1941)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-08-08 15:44:25 +00:00
Jason Song 22d91e3ac3 Merge tag 'nektos/v0.2.49'
Conflicts:
	cmd/input.go
	go.mod
	go.sum
	pkg/exprparser/interpreter.go
	pkg/model/workflow.go
	pkg/runner/expression.go
	pkg/runner/job_executor.go
	pkg/runner/runner.go
2023-08-02 11:52:14 +08:00
808cf5a2c3 throw when invalid uses key is provided (#1804)
* throw if `uses` is invalid

* update JobType to return error

* lint

* put //nolint:dupl on wrong test

* update error message to remove end punctuation

* lint

* update remote job type check

* move if statement

* rm nolint:dupl ... we'll see how that goes

---------

Co-authored-by: Casey Lee <[email protected]>
2023-07-10 21:27:43 -07:00
3ac2b726f2 Fix bug in processing jobs on platforms without Docker (#1834)
* Log incoming jobs.

Log the full contents of the job protobuf to make debugging jobs easier

* Ensure that the parallel executor always uses at least one thread.

The caller may mis-calculate the number of CPUs as zero, in which case
ensure that at least one thread is spawned.

* Use runtime.NumCPU for CPU counts.

For hosts without docker, GetHostInfo() returns a blank struct which
has zero CPUs and causes downstream trouble.

---------

Co-authored-by: Paul Armstrong <[email protected]>
Co-authored-by: Jason Song <[email protected]>
2023-06-06 03:00:54 +00:00
Jason Song 229dbaf153 Merge tag 'nektos/v0.2.45' 2023-05-04 17:45:53 +08:00
Zettat123andGitHub baf3bcf48b avoid using log.Fatal (#1759) 2023-04-25 02:09:54 +00:00
Zettat123andJason Song 0c1f2edb99 Support specifying command for services (#50)
This PR is to support overwriting the default `CMD` command of `services` containers.

This is a Gitea specific feature and GitHub Actions doesn't support this syntax.

Reviewed-on: https://gitea.com/gitea/act/pulls/50
Reviewed-by: Jason Song <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2023-04-23 14:55:17 +08:00
Jason SongGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
816a7d410a Avoid using log.Fatal in pkg/* (#1705)
* fix: common

* fix: in runner

* fix: decodeNode

* fix: GetMatrixes

* Revert "fix: common"

This reverts commit 6599803b6ae3b7adc168ef41b4afd4d89fc22f34.

* fix: GetOutboundIP

* test: fix cases

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-04-18 14:17:36 +00:00
ChristopherHXandGitHub 97749a27b9 fix: ghc assignment typo (#1729)
* fix: ghc assignment typo

* fixup server_url
2023-04-13 14:09:29 +00:00
ChristopherHXGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
d70b225e85 fix: reusable workflow panic (#1728)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-04-13 13:47:59 +00:00
Markus WolfandGitHub c0130ed030 fix: add server_url attribute to github context (#1727)
* fix: add `server_url` attribute to github context

The `server_urL` attribute was missing in the `github` context.
Previously it was exposed as environment variable only.

Closes #1726

* fix: also set `api_url` and `graphql_url` attributes
2023-04-13 13:09:28 +00:00
Jason SongandLunny Xiao 5c4a96bcb7 Avoid using log.Fatal in pkg/* (#39)
Follow https://github.com/nektos/act/pull/1705

Reviewed-on: https://gitea.com/gitea/act/pulls/39
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Jason Song <[email protected]>
Co-committed-by: Jason Song <[email protected]>
2023-04-07 16:31:03 +08:00
Zettat123andJason Song 5e76853b55 Support reusable workflow (#34)
Fix https://gitea.com/gitea/act_runner/issues/80
Fix https://gitea.com/gitea/act_runner/issues/85

To support reusable workflows, I made some improvements:
- read `yml` files from both `.gitea/workflows` and `.github/workflows`
- clone repository for local reusable workflows because the runner doesn't have the code in its local directory
- fix the incorrect clone url like `https://https://gitea.com`

Co-authored-by: Jason Song <[email protected]>
Reviewed-on: https://gitea.com/gitea/act/pulls/34
Reviewed-by: Jason Song <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2023-03-29 13:59:22 +08:00
Jason Song 1dda0aec69 Merge tag 'nektos/v0.2.43'
Conflicts:
	pkg/container/docker_run.go
	pkg/runner/action.go
	pkg/runner/logger.go
	pkg/runner/run_context.go
	pkg/runner/runner.go
	pkg/runner/step_action_remote_test.go
2023-03-16 11:45:29 +08:00
Markus WolfandGitHub 6744e68ee2 fix: correct ref and ref_name (#1672)
* fix: correct ref and ref_name

The ref in the GitHub context is always full qualified
(e.g. refs/heads/branch, refs/tags/v1).
The ref_name is the ref with the strippep prefix.
In case of pull_requests, this is the merge commit ref
(e.g. refs/pull/123/merge -> 123/merge).

* test: update test data
2023-03-09 20:03:13 +00:00
0671d16694 Fix missing ActionRunsUsingGo (#20)
- Allow `using: "go"` when unmarshalling YAML.
- Add `ActionRunsUsingGo` to returned errors.

Co-authored-by: Zettat123 <[email protected]>
Reviewed-on: https://gitea.com/gitea/act/pulls/20
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2023-03-09 22:51:58 +08:00
Markus WolfGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
89cb558558 fix: update output handling for reusable workflows (#1521)
* fix: map job output for reusable workflows

This fixes the job outputs for reusable workflows. There is
a required indirection. Before this we took the outputs from
all jobs which is not what users express with the workflow
outputs.

* fix: remove double evaluation

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-02-23 22:34:47 +00:00
Josh SorefandGitHub be4a1477a5 fix: tolerate workflow that needs a missing job (#1595) (#1619)
Change planner functions to return errors

This enables createStages to return `unable to build dependency graph`

Fix PlanEvent to properly report errors relating to events/workflows
2023-02-16 16:41:59 +00:00
Lunny XiaoandJason Song 4b99ed8916 Support go run on action (#12)
Reviewed-on: https://gitea.com/gitea/act/pulls/12
Reviewed-by: Jason Song <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-committed-by: Lunny Xiao <[email protected]>
2023-02-15 16:10:15 +08:00
Shubh BapnaandGitHub ce168f9595 feat: allow overriding of GITHUB_ env variables (#1582)
* allow overriding of GITHUB_ env variables

* bug fix for overriding env vars with empty string

* revert step.go

* refactor github_context to prevent lint failures. added more setters

* added ability to override github env variables

* handled base and head ref
2023-02-03 19:35:49 +00:00
ChristopherHXGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
b8d7e947cf refactor: fix savestate in pre steps (#1466)
* refactor: fix savestate in pre steps

* fix pre steps collision

* fix tests

* remove

* enable tests

* Update pkg/runner/action.go

* Rename InterActionState to IntraActionState

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-12-15 17:08:31 +00:00
Markus WolfGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
a8e05cded6 feat: allow to spawn and run a local reusable workflow (#1423)
* feat: allow to spawn and run a local reusable workflow

This change contains the ability to parse/plan/run a local
reusable workflow.
There are still numerous things missing:

- inputs
- secrets
- outputs

* feat: add workflow_call inputs

* test: improve inputs test

* feat: add input defaults

* feat: allow expressions in inputs

* feat: use context specific expression evaluator

* refactor: prepare for better re-usability

* feat: add secrets for reusable workflows

* test: use secrets during test run

* feat: handle reusable workflow outputs

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-12-15 16:45:22 +00:00
appleboy 88cce47022 feat(workflow): support schedule event (#4)
fix https://gitea.com/gitea/act/issues/3

Signed-off-by: Bo-Yi.Wu <[email protected]>

Co-authored-by: Bo-Yi.Wu <[email protected]>
Reviewed-on: https://gitea.com/gitea/act/pulls/4
2022-12-10 09:14:14 +08:00
Markus WolfandGitHub 0f8861b9e3 fix: handle env-vars case sensitive (#1493)
Closes #1488
2022-12-07 15:31:33 +00:00
Jason Song 7920109e89 Merge tag 'nektos/v0.2.34' 2022-12-05 17:08:17 +08:00
87327286d5 Fix shellcommand error on sh shell (#1464)
Co-authored-by: Lim Chun Leng <[email protected]>
2022-11-25 10:38:49 +00:00
Jason SongandJason Song 64cae197a4 Support step number 2022-11-22 16:11:35 +08:00
Jason SongandJason Song 7815eec33b Add custom enhancements 2022-11-22 14:16:35 +08:00
Markus WolfGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
9b95a728d8 feat: parse types of reusable workflows (#1414)
This change does parse the different types of workflow jobs.
It is not much by itself but the start to implement reusable
workflows.

Relates to #826

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-11-01 15:58:07 +00:00
Eng Zer JunGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2f1c5a19f1 refactor: move from io/ioutil to io and os packages (#1417)
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <[email protected]>

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-10-29 17:15:38 +00:00
Markus WolfandGitHub 1e0ef8ce69 Mapping workflow_dispatch inputs into the Expression inputs context (#1363)
* test: check workflow_dispatch inputs

This implements a test to check for `workflow_dispatch` inputs.
This will be a prerequisite for implementing the inputs.

* feat: map workflow_dispatch input to expression evaluator

This changes adds the workflow_dispatch event inputs
to the `inputs` context and maintaining the boolean type

* fix: coerce boolean input types

* fix: use step env if available, rc env otherwise
2022-10-17 16:25:26 +00:00
Alex SavchukGitHubmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
48188a6280 fix: support docker create arguments from container.options (#1022) (#1351)
* fix: support docker create arguments from container.options (#1022)

* fix processing of errors, add verbose logging, fix test

* disable linter for code copied from docker/cli

* fix all linter issues

* Add license info

* Add opts_test.go from docker/cli and required testdata

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-10-06 22:09:43 +00:00
Markus WolfandGitHub 679cac1677 Fix composite input handling (#1345)
* test: add test case for #1319

* fix: setup of composite inputs

This change fixes the composite action setup handling of inputs.

All inputs are taken from the env now. The env is composed of
the 'level above'.
For example:
- step env -> taken from run context
- action env -> taken from step env
- composite env -> taken from action env

Before this change the env setup for steps, actions and composite
run contexts was harder to understand as all parts looked into
one of these: parent run context, step, action, composite run context.

Now the 'data flow' is from higher levels to lower levels which should
make it more clean.

Fixes #1319

* test: add simple remote composite action test

Since we don't have a remote composite test at all
before this, we need at least the simplest case.
This does not check every feature, but ensures basic
availability of remote composite actions.

* refactor: move ActionRef and ActionRepository

Moving ActionRef and ActionRepository from RunContext into the
step, allows us to remove the - more or less - ugly copy operations
from the RunContext.

This is more clean, as each step does hold the data required anyway
and the RunContext shouldn't know about the action details.

* refactor: remove unused properties
2022-10-06 21:58:16 +00:00