1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-16 18:01:34 +00:00
Commit graph

708 commits

Author SHA1 Message Date
Earl Warren
810fe46843
Update module github.com/imdario/mergo to v1 (followup) 2025-08-11 07:36:24 +02:00
Earl Warren
be5c615201
fix: prevent unintended input replacement in reusable workflows with workflow_dispatch when using workflow_call (#833)
Refs https://github.com/nektos/act/pull/2349

---

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

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

---------

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
(cherry picked from commit f4f4265e977a760e0637a65b1554af2cada034cc)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/833): <!--number 833 --><!--line 0 --><!--description Zml4OiBwcmV2ZW50IHVuaW50ZW5kZWQgaW5wdXQgcmVwbGFjZW1lbnQgaW4gcmV1c2FibGUgd29ya2Zsb3dzIHdpdGggd29ya2Zsb3dfZGlzcGF0Y2ggd2hlbiB1c2luZyB3b3JrZmxvd19jYWxs-->fix: prevent unintended input replacement in reusable workflows with workflow_dispatch when using workflow_call<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: S. M. Mahmudul Haque (Yamin) <haque@campus.tu-berlin.de>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/833
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-10 19:37:14 +00:00
Earl Warren
4e5a3025d7
chore: "unable to get git repo" is a debug message, not a warning (#822)
Refs https://github.com/nektos/act/pull/2495

---

* Disable "unable to get git repo" when none exists.

* Restore error back so it's included in bug reports

Change from Warningf to Debugf.

---------

Co-authored-by: Casey Lee <cplee@nektos.com>
(cherry picked from commit e42a534b2e65d28b41532f9a44d18c0354aecfc2)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/822): <!--number 822 --><!--line 0 --><!--description Y2hvcmU6ICJ1bmFibGUgdG8gZ2V0IGdpdCByZXBvIiBpcyBhIGRlYnVnIG1lc3NhZ2UsIG5vdCBhIHdhcm5pbmcgW3NraXAgY2FzY2FkZV0=-->chore: "unable to get git repo" is a debug message, not a warning [skip cascade]<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Steven Edwards <cureadvocate@gmail.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/822
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-10 16:24:49 +00:00
Earl Warren
b236cb64f9
fix: composite action input pollution (#818)
refuses to use the default for an nodejs input when an composite action has an input with the same name.

clean cherry-pick (except for trivial context conflict) of two related pull requests

- https://github.com/nektos/act/pull/2348
- https://github.com/nektos/act/pull/2473

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/818): <!--number 818 --><!--line 0 --><!--description Zml4OiBjb21wb3NpdGUgYWN0aW9uIGlucHV0IHBvbGx1dGlvbg==-->fix: composite action input pollution<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/818
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-10 16:24:19 +00:00
Earl Warren
931c2c0ac3
feat: added support for dereferenced map properties (#821)
Refs https://github.com/nektos/act/pull/2635

---

* Added support for dereferenced properties

* Added negative test

* Update pkg/exprparser/functions_test.go

Co-authored-by: ChristopherHX <christopher.homberger@web.de>

* Update pkg/exprparser/functions_test.go

Co-authored-by: ChristopherHX <christopher.homberger@web.de>

* fix lint

---------

Co-authored-by: m1r4c <lars-github@domesjo.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
(cherry picked from commit 20bb25432dd8db44c689a3bc2d440a648e71b3bb)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- features
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/821): <!--number 821 --><!--line 0 --><!--description ZmVhdDogYWRkZWQgc3VwcG9ydCBmb3IgZGVyZWZlcmVuY2VkIG1hcCBwcm9wZXJ0aWVz-->feat: added support for dereferenced map properties<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: m1r4c <lars-github.com@domesjo.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/821
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-10 16:24:02 +00:00
Earl Warren
e049c82d9c
chore: cancel context used in CI when running workflows (#831)
the context obtained from context.Background() may otherwise survive the test instead. It is equivalent to t.Context() which is only available in go >= v1.24

---

It is suspected to be the cause of

```
2025-08-10T13:01:08.5866723Z [services/Reproduction of failing Services interpolation] [DEBUG] Writing entry to tarball workflow/event.json len:2
2025-08-10T13:01:08.5866772Z [services/Reproduction of failing Services interpolation] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
2025-08-10T13:01:08.5866818Z [services/Reproduction of failing Services interpolation] [DEBUG] Extracting content to '/var/run/act/'
2025-08-10T13:01:08.5866868Z [services/Reproduction of failing Services interpolation] service [postgres]: container health check a6b5d1443dd78f3d3aa244aeccabe72542f1c1ee33200f74a9ea33ae736f01f0 (code.forgejo.org/oci/postgres:16) is starting, waiting 10s
2025-08-10T13:01:08.5866919Z panic: test timed out after 10m0s
2025-08-10T13:01:08.5866984Z 	running tests:
2025-08-10T13:01:08.5867024Z 		TestRunner_RunWithService (2s)
2025-08-10T13:01:08.5867081Z
2025-08-10T13:01:08.5867142Z goroutine 55693 [running]:
2025-08-10T13:01:08.5867206Z testing.(*M).startAlarm.func1()
2025-08-10T13:01:08.5867250Z 	/go_path/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.12.linux-amd64/src/testing/testing.go:2373 +0x385
2025-08-10T13:01:08.5867300Z created by time.goFunc
2025-08-10T13:01:08.5867368Z 	/go_path/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.12.linux-amd64/src/time/sleep.go:215 +0x2d
...
2025-08-10T13:01:08.5878289Z goroutine 55692 [select]:
2025-08-10T13:01:08.5878350Z code.forgejo.org/forgejo/runner/v9/act/runner.waitForServiceContainer({0xf12e50, 0xc0006bbe30}, {0xf1e120, 0xc0003643c0})
2025-08-10T13:01:08.5878402Z 	/home/debian/.cache/act/7ffa26f4231b52fa/hostexecutor/act/runner/run_context.go:757 +0xd7
2025-08-10T13:01:08.5878460Z code.forgejo.org/forgejo/runner/v9/act/runner.(*RunContext).waitForServiceContainers.func1.1({0xf12e50?, 0xc0006bbe30?})
2025-08-10T13:01:08.5878524Z 	/home/debian/.cache/act/7ffa26f4231b52fa/hostexecutor/act/runner/run_context.go:770 +0x25
2025-08-10T13:01:08.5878592Z code.forgejo.org/forgejo/runner/v9/act/runner.(*RunContext).waitForServiceContainers.func1.NewParallelExecutor.2.1(0xc00015a5b0, 0xc00015a700)
2025-08-10T13:01:08.5878684Z 	/home/debian/.cache/act/7ffa26f4231b52fa/hostexecutor/act/common/executor.go:107 +0x52
2025-08-10T13:01:08.5878729Z created by code.forgejo.org/forgejo/runner/v9/act/runner.(*RunContext).waitForServiceContainers.func1.NewParallelExecutor.2 in goroutine 55682
2025-08-10T13:01:08.5878777Z 	/home/debian/.cache/act/7ffa26f4231b52fa/hostexecutor/act/common/executor.go:105 +0xf4
2025-08-10T13:01:08.5878821Z

...
```

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/831): <!--number 831 --><!--line 0 --><!--description Y2hvcmU6IGNhbmNlbCBjb250ZXh0IHVzZWQgaW4gQ0kgd2hlbiBydW5uaW5nIHdvcmtmbG93cyBbc2tpcCBjYXNjYWRlXQ==-->chore: cancel context used in CI when running workflows [skip cascade]<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/831
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-10 15:10:30 +00:00
Mathieu Fenniak
a737f197c7
test: fix failures caused by node24 usage in hello-world-javascript-action [skip cascade] (#830)
node24 support has been added to GitHub Actions runner (https://github.com/actions/runner/releases/tag/v2.327.1), after which hello-world-javascript-action was updated to node24 (d5e3943272) causing test failures since forgejo-runner doesn't support `node24`.  To unblock test execution, this pins to the `v1` tag which was already done in two other tests anyway.

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/830): <!--number 830 --><!--line 0 --><!--description dGVzdDogZml4IGZhaWx1cmVzIGNhdXNlZCBieSBub2RlMjQgdXNhZ2UgaW4gaGVsbG8td29ybGQtamF2YXNjcmlwdC1hY3Rpb24gW3NraXAgY2FzY2FkZV0=-->test: fix failures caused by node24 usage in hello-world-javascript-action [skip cascade]<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/830
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-08-10 12:03:50 +00:00
Mathieu Fenniak
7a31b6a55e
feat: support evaluation of concurrency clauses in runner (#827)
Pre-req for support `concurrency` clauses for Gitea Actions, later added to Gitea in PR: https://github.com/go-gitea/gitea/pull/32751. Unit tests added in this PR relative to upstream.

Squashes PRs https://gitea.com/gitea/act/pulls/124 & https://gitea.com/gitea/act/pulls/139, as noted in https://code.forgejo.org/forgejo/runner/issues/678

Reviewed-on: https://gitea.com/gitea/act/pulls/124
Reviewed-by: Lunny Xiao <lunny@noreply.gitea.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>
Reviewed-on: https://gitea.com/gitea/act/pulls/139
Reviewed-by: Zettat123 <zettat123@noreply.gitea.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-committed-by: ChristopherHX <christopher.homberger@web.de>

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- features
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/827): <!--number 827 --><!--line 0 --><!--description ZmVhdDogc3VwcG9ydCBldmFsdWF0aW9uIG9mIGNvbmN1cnJlbmN5IGNsYXVzZXMgaW4gcnVubmVy-->feat: support evaluation of concurrency clauses in runner<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/827
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-08-07 21:47:01 +00:00
Earl Warren
3f468733cb
fix: valueMasker concurrent map write (#825)
* valueMasker create secrets copy

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 7ed767c23a554eefb0a7563c674e7a406393b60f)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/825): <!--number 825 --><!--line 0 --><!--description Zml4OiB2YWx1ZU1hc2tlciBjb25jdXJyZW50IG1hcCB3cml0ZQ==-->fix: valueMasker concurrent map write<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/825
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-07 21:36:28 +00:00
earl-warren
4f883e9707
fix: short sha has at least four digits (#820)
Refs https://github.com/nektos/act/pull/2540

---

Currently it is not very unlikly to have a false match for tag `0` with sha `0XXXXXXXXXXXXXXXXXXXXXXX`, 1 to 16

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit 4dc67f6ba28f888328a2568bbcacf49e552650da)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/820): <!--number 820 --><!--line 0 --><!--description Zml4OiBzaG9ydCBzaGEgaGFzIGF0IGxlYXN0IGZvdXIgZGlnaXRz-->fix: short sha has at least four digits<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/820
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
2025-08-07 21:04:09 +00:00
earl-warren
e100e3084c
feat: log parsed commands and step summary (#824)
Refs https://github.com/nektos/act/pull/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>
(cherry picked from commit bb7db7b1c8a456d46907f3e65a6c4c2c1dcb6286)

```
Conflicts:
	act/runner/command.go
	act/runner/runner_test.go

  trivial context conflicts for both
```

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- features
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/824): <!--number 824 --><!--line 0 --><!--description ZmVhdDogbG9nIHBhcnNlZCBjb21tYW5kcyBhbmQgc3RlcCBzdW1tYXJ5-->feat: log parsed commands and step summary<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/824
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
2025-08-07 21:03:44 +00:00
Earl Warren
5f1224ba5f
feat: added info log when container image platform mismatched (#826)
Refs https://github.com/nektos/act/pull/3225

---

* added info log when container image platform mismatched

* inline image architecture comparison into ImageExistsLocally function as per review request

(cherry picked from commit 77d31c96a9486553908fdeb1c3053015238d5a0a)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- features
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/826): <!--number 826 --><!--line 0 --><!--description ZmVhdDogYWRkZWQgaW5mbyBsb2cgd2hlbiBjb250YWluZXIgaW1hZ2UgcGxhdGZvcm0gbWlzbWF0Y2hlZA==-->feat: added info log when container image platform mismatched<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Ryan Fleet <rmfleet@gmail.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/826
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-07 13:51:55 +00:00
earl-warren
e22d12ae53
fix: amd64 arch to X64 (#2580) (#819)
(cherry picked from commit c671295aab9192b49e4acc981e9c5b2c1d567884)

Refs https://github.com/nektos/act/pull/2580/files

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/819): <!--number 819 --><!--line 0 --><!--description Zml4OiBhbWQ2NCBhcmNoIHRvIFg2NCAoIzI1ODAp-->fix: amd64 arch to X64 (#2580)<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: derrik <82898438+derrik-fleming@users.noreply.github.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/819
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-08-07 09:50:35 +00:00
earl-warren
79285e896b
chore: run_context: add GITHUB_RUN_ATTEMPT (#2458) (#817)
* 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>
(cherry picked from commit 4178166d289bae351ef6d33414cc569518e62a01)

```
Conflicts:
	act/runner/run_context.go
    trivial context conflict
	act/runner/step_test.go
    the corresponding test was removed in the Forgejo runner
```

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/817): <!--number 817 --><!--line 0 --><!--description Y2hvcmU6IHJ1bl9jb250ZXh0OiBhZGQgR0lUSFVCX1JVTl9BVFRFTVBUICgjMjQ1OCk=-->chore: run_context: add GITHUB_RUN_ATTEMPT (#2458)<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: Ryan <cattm@protonmail.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/817
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-08-07 08:02:28 +00:00
Earl Warren
96891ab314
feat: wait for services to be healthy before starting a job (#805)
If a --health-cmd is defined for a container, block until its status is healthy or unhealthy. The timeout is defined by the server internal logic based on associated --health-* defined delays. If it blocks indefinitely, the job timeout will eventually cancel it.

While waiting, the simplest solution would be to sleep 1 second until the container is healthy or unhealthy. To minimize log verbosity, the sleep interval is instead set to --health-interval and default to one second if it is not defined.

This logic does not apply to host containers as they do not support services. They are assumed to always be healthy.

If --health-cmd is set for the container running a job, the first step will start to run without waiting for the container to become healthy. There may be valid use cases for that but they are not the focus of this implementation.

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- features
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/805): <!--number 805 --><!--line 0 --><!--description ZmVhdDogd2FpdCBmb3Igc2VydmljZXMgdG8gYmUgaGVhbHRoeSBiZWZvcmUgc3RhcnRpbmcgYSBqb2I=-->feat: wait for services to be healthy before starting a job<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/805
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-07 04:36:26 +00:00
Earl Warren
8b7e126c1c
fix: log the URL of the action when it fails schema validation (#810)
```
$ go test -v -run='TestRunner_RunEvent$/local-action-fails-schema-validation' ./act/runner
...
[fails-schema-validation/test]     Failure - Main ./local-action-fails-schema-validation/action
[fails-schema-validation/test] failed to validate action.y*ml from action './local-action-fails-schema-validation/action' with path '': Line: 2 Column 3: Failed to match null: Line: 2 Column 3: Expected a scalar got mapping
Line: 2 Column 3: Failed to match inputs-mapping: Line: 3 Column 5: Failed to match null: Line: 3 Column 5: Expected a scalar got mapping
Line: 3 Column 5: Failed to match input-mapping: Line: 3 Column 14: Unknown Variable Access secrets
...
```

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/810): <!--number 810 --><!--line 0 --><!--description Zml4OiBsb2cgdGhlIFVSTCBvZiB0aGUgYWN0aW9uIHdoZW4gaXQgZmFpbHMgc2NoZW1hIHZhbGlkYXRpb24=-->fix: log the URL of the action when it fails schema validation<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/810
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-04 13:20:22 +00:00
cascading-pr
ce0c5b2b78
upgrade lxc-helpers (#806)
cascading-pr from https://code.forgejo.org/forgejo/lxc-helpers/pulls/41

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/806): <!--number 806 --><!--line 0 --><!--description dXBncmFkZSBseGMtaGVscGVycw==-->upgrade lxc-helpers<!--description-->
<!--end release-notes-assistant-->

Co-authored-by: cascading-pr <cascading-pr@example.com>
Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/806
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: cascading-pr <cascading-pr@noreply.code.forgejo.org>
Co-committed-by: cascading-pr <cascading-pr@noreply.code.forgejo.org>
2025-08-04 08:06:31 +00:00
Mathieu Fenniak
646a0d761f
fix: longer timeouts on job cleanup without waiting (v2) (#798)
Probably fixes #431 (see investigation notes: https://code.forgejo.org/forgejo/runner/issues/431#issuecomment-50810) by extending the timeout for all cleanup actions from 1 minute to 30 minutes, and run cleanup after the task status is reported back to Forgejo.  Cleanup logging now goes in the runner log rather than the job log, and it was tweaked to be less verbose and contain more useful identifying information on the job in case of error.

Manual testing confirms that Forgejo receives the success/failure status of the task before cleanup begins, that no further logging reaches the task at that point, and that the longer cleanup timeout is applied as expected.

This is an alternate, simplified version of #779.

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/798): <!--number 798 --><!--line 0 --><!--description Zml4OiBsb25nZXIgdGltZW91dHMgb24gam9iIGNsZWFudXAgd2l0aG91dCB3YWl0aW5nICh2Mik=-->fix: longer timeouts on job cleanup without waiting (v2)<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/798
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
2025-08-03 07:01:46 +00:00
Earl Warren
65d762d1cc
feat: --health-* options are allowed in job.<id>.services.<id>.options (#784)
they override any similar options from the configuration file since it would not make much sense to define a health check that applies to all containers, it is only ever meaningful for services.

```yaml
jobs:
  mysql:
    runs-on: ubuntu-latest
    container: mysql:8
    services:
      maindb:
        image: mysql:8
        env:
          MYSQL_DATABASE: dbname
          MYSQL_USER: dbuser
          MYSQL_PASSWORD: dbpass
          MYSQL_RANDOM_ROOT_PASSWORD: yes
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
```

they are also allowed in job.<id>.container.options although they are not useful because they are harmless

See also the [associated documentation](https://codeberg.org/forgejo/docs/pulls/1366) pull request.

---

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- features
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/784): <!--number 784 --><!--line 0 --><!--description ZmVhdDogLS1oZWFsdGgtKiBvcHRpb25zIGFyZSBhbGxvd2VkIGluIGpvYi48aWQ+LnNlcnZpY2VzLjxpZD4ub3B0aW9ucw==-->feat: --health-* options are allowed in job.<id>.services.<id>.options<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/784
Reviewed-by: Gusted <gusted@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-02 23:51:09 +00:00
Earl Warren
79f6c54675
chore: replace docker hub with code.forgejo.org (#799)
<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/799): <!--number 799 --><!--line 0 --><!--description Y2hvcmU6IHJlcGxhY2UgZG9ja2VyIGh1YiB3aXRoIGNvZGUuZm9yZ2Vqby5vcmc=-->chore: replace docker hub with code.forgejo.org<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/799
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-02 21:55:57 +00:00
Earl Warren
b26db065d6
fix: vars context is allowed in default values of action inputs (#786)
Resolves forgejo/runner#785

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/786): <!--number 786 --><!--line 0 --><!--description Zml4OiB2YXJzIGNvbnRleHQgaXMgYWxsb3dlZCBpbiBkZWZhdWx0IHZhbHVlcyBvZiBhY3Rpb24gaW5wdXRz-->fix: vars context is allowed in default values of action inputs<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/786
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-02 06:38:42 +00:00
Earl Warren
a01cb5e6c5
chore(ci): autoremove when running a workflow in a test (#780)
Otherwise resources linger when tests are checking for conditions that
require a workflow to fail.

```sh
earl-warren:~/software/runner$ go test -count=1 -run='TestJobExecutorWorkflows/uses-github-short-sha' ./act/runner
ok  	code.forgejo.org/forgejo/runner/v9/act/runner	0.276s
earl-warren:~/software/runner$ docker network ls | grep WORKFLOW
2e57caeb514d   WORKFLOW-cc93880718786fef12c18e53feecee5c8ef1cc155840bf4c0275a2fca61b99b9_JOB-test-test-network   bridge    local
earl-warren:~/software/runner$
```

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/780): <!--number 780 --><!--line 0 --><!--description Y2hvcmUoY2kpOiBhdXRvcmVtb3ZlIHdoZW4gcnVubmluZyBhIHdvcmtmbG93IGluIGEgdGVzdA==-->chore(ci): autoremove when running a workflow in a test<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/780
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-08-01 14:06:32 +00:00
Earl Warren
ec99579451
chore: to allow the runner to be imported, v9 needs to be in the go module (#777)
It will be imported by Forgejo.

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/777): <!--number 777 --><!--line 0 --><!--description Y2hvcmU6IHRvIGFsbG93IHRoZSBydW5uZXIgdG8gYmUgaW1wb3J0ZWQsIHY5IG5lZWRzIHRvIGJlIGluIHRoZSBnbyBtb2R1bGU=-->chore: to allow the runner to be imported, v9 needs to be in the go module<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/777
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-31 10:35:11 +00:00
Earl Warren
29cc7e1a71
fix: allow expressions in action descriptions and incomplete action inputs (#770)
They are commonly used for documentation purposes and never evaluated.

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/770): <!--number 770 --><!--line 0 --><!--description Zml4OiBhbGxvdyBleHByZXNzaW9ucyBpbiBhY3Rpb24gZGVzY3JpcHRpb25zIGFuZCBpbmNvbXBsZXRlIGFjdGlvbiBpbnB1dHM=-->fix: allow expressions in action descriptions and incomplete action inputs<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/770
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-31 04:35:19 +00:00
Earl Warren
660e24bff5
fix: the vars context is allowed in an action step env (#761)
the actions schema validation must not fail when using an
expression such as:

```yaml
runs:
  using: composite
  steps:
    - name: Build the container image for each architecture
      env:
        BUILDKIT_HOST: ${{ vars.BUILDKIT_HOST }}
      run: buildkit-build.sh
```

---

Without the fix, the test fails with:

```
go test -run=TestActionSchema -v ./act/schema
=== RUN   TestActionSchema
    schema_test.go:153:
        	Error Trace:	/home/earl-warren/software/runner/act/schema/schema_test.go:153
        	Error:      	Received unexpected error:
        	            	Line: 14 Column 3: Failed to match container-runs: Line: 15 Column 3: Unknown Property steps
        	            	Line: 14 Column 3: Failed to match node-runs: Line: 15 Column 3: Unknown Property steps
        	            	Line: 14 Column 3: Failed to match plugin-runs: Line: 14 Column 3: Unknown Property using
        	            	Line: 15 Column 3: Unknown Property steps
        	            	Line: 14 Column 3: Failed to match composite-runs: Line: 16 Column 7: Failed to match run-step: Line: 19 Column 18: Unknown Variable Access vars
        	            	Line: 16 Column 7: Failed to match uses-step: Line: 16 Column 7: Unknown Property run
        	            	Line: 19 Column 18: Unknown Variable Access vars
        	Test:       	TestActionSchema
--- FAIL: TestActionSchema (0.00s)
FAIL
FAIL	code.forgejo.org/forgejo/runner/act/schema	0.003s
FAIL
```

---

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/761): <!--number 761 --><!--line 0 --><!--description Zml4OiB0aGUgdmFycyBjb250ZXh0IGlzIGFsbG93ZWQgaW4gYW4gYWN0aW9uIHN0ZXAgZW52-->fix: the vars context is allowed in an action step env<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/761
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-30 11:06:55 +00:00
Earl Warren
65dd9d4998
fix: allow expressions in step and job uses: (#766)
Resolves forgejo/runner#764

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/766): <!--number 766 --><!--line 0 --><!--description Zml4OiBhbGxvdyBleHByZXNzaW9ucyBpbiBzdGVwIGFuZCBqb2IgdXNlczo=-->fix: allow expressions in step and job uses:<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/766
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-30 07:35:48 +00:00
Earl Warren
a9ecd52de8
fix(ci): use code.forgejo.org instead of the docker hub (#762)
- use https://code.forgejo.org/forgejo/hello-world-docker-action/ that is a copy of https://github.com/actions/hello-world-docker-action/ with a patch to not use the docker hub
- node:16-buster-slim replaced with code.forgejo.org/oci/node:22 and checked that whatever is tested with it is not likely to be disturbed by the change in version
- change base images of Dockerfile to be from code.forgejo.org/oci/ equivalents
- use code.forgejo.org/forgejo/runner:8 instead of catthehacker/ubuntu:runner-latest

To test services:

- use code.forgejo.org/oci/bitnami/postgresql:16 instead of postgres:12
- use code.forgejo.org/oci/apache-git:1 instead of nginx:latest

Skip flaky test and [open an issue for it](https://code.forgejo.org/forgejo/runner/issues/763).

---

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/762): <!--number 762 --><!--line 0 --><!--description Zml4KGNpKTogdXNlIGNvZGUuZm9yZ2Vqby5vcmcgaW5zdGVhZCBvZiB0aGUgZG9ja2VyIGh1Yg==-->fix(ci): use code.forgejo.org instead of the docker hub<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/762
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-29 15:37:16 +00:00
Earl Warren
a6fa98926c
chore: a single testutils for both act and the runner (#759)
keep it DRY

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner/-->
- other
  - [PR](https://code.forgejo.org/forgejo/runner//pulls/759): <!--number 759 --><!--line 0 --><!--description Y2hvcmU6IGEgc2luZ2xlIHRlc3R1dGlscyBmb3IgYm90aCBhY3QgYW5kIHRoZSBydW5uZXI=-->chore: a single testutils for both act and the runner<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/759
Reviewed-by: fnetX <fnetx@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-29 13:34:04 +00:00
Earl Warren
bcddcef2b9
chore: import the ACT test workflow
- remove go vet and build as they are now redundant
- replace ./pkg with ./act
- rename the workflow from test to act to distinguish it from the
  runner workflow

cleanup and factorization with the runner workflow is left for later
2025-07-28 19:47:12 +02:00
Earl Warren
ebc7758c1f
chore: s|github.com/nektos/act/pkg|code.forgejo.org/forgejo/runner/act| 2025-07-28 19:23:07 +02:00
Earl Warren
c377159121 chore: use the same .golangci.yml as the runner & gofumpt over gofmt (#206)
To prepare for a smooth merge in the runner codebase.

- run with --fix for gofumpt and golangci
- manual edits for
  - disabling useless package naming warning
  - rename variables that had underscore in their name
  - remove trailing else at the end of a few functions

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/206
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-28 12:26:41 +00:00
Earl Warren
ed98625ae9 chore: remove tests for node12 and node16 (#205)
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/205
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-28 10:05:01 +00:00
Earl Warren
87d973b894 chore(tests): add coverage for ./pkg/runner (#202)
Only changes test files.

---

- remove tests specific to running on a host with no container
  they are the same as with the containers (TestRunEventHostEnvironment)
- prefix the name of the tests with a distinctive name to
  more easily run them together
- use code.forgejo.org/oci images whereever possible
- remove some tests that are either
  - difficult to understand (ancient bugs)
  - not yet well understood (related to reusable workflows)
  - depend on github (generation of workflows to be run on the fly
    e.g. updateTestIfWorkflow)
- fix the TestSanitizeNetworkAlias tests that were not run
  and make them easier to debug
- disable tests of options that are forbidden in Forgejo Actions
  (testdata/container-hostname/push.yml)

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/202
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-28 06:18:46 +00:00
Earl Warren
30ea23384a feat!: remove support for using an artifact server via CLI (#199)
Refs https://code.forgejo.org/forgejo/runner/pulls/740

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/199
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-27 20:35:48 +00:00
Earl Warren
1b0c31121a chore(tests): add coverage for ./pkg/artifactcache (#198)
https://code.forgejo.org/forgejo/act/actions/runs/1157/jobs/0#jobstep-10-251
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/198
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-27 15:25:14 +00:00
Earl Warren
34939ad5f4 fix: allow using the env context in actions defaults (#204)
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/204
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-27 15:24:49 +00:00
Earl Warren
57524e90f1 fix: tolerate strings for fail-fast, max-parallel, timeout-minutes, cancel-timeout-minutes (#203)
- the model defines them as strings and can parse them either as string or their effective type (boolean, number)
- add workflow validation when reading all testdata
- add fail-fast, max-parallel, timeout-minutes, cancel-timeout-minutes to test workflows in the jobparser tests

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/203
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-27 10:06:07 +00:00
Earl Warren
82dea3fdda chore(tests): add coverage for ./pkg/container (#201)
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/201
Reviewed-by: msrd0 <msrd0@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-26 16:37:12 +00:00
Earl Warren
765b95080b fix: runs-on is also mandatory for reusable workflows and may be needing container (#194)
If not the schema validation will fail because it will be try to validate as if not calling a reusable workflow.

```
=== RUN   TestWorkflowCallRunsOn
    schema_test.go:119:
        	Error Trace:	/home/earl-warren/software/act/pkg/schema/schema_test.go:119
        	Error:      	Received unexpected error:
        	            	Line: 10 Column 5: Failed to match job-factory: Line: 12 Column 5: Unknown Property uses
        	            	Line: 13 Column 5: Unknown Property with
        	            	Line: 15 Column 5: Unknown Property secrets
        	            	Line: 10 Column 5: Failed to match workflow-job: Line: 11 Column 5: Unknown Property runs-on
        	Test:       	TestWorkflowCallRunsOn
```

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/194
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-26 12:24:41 +00:00
Earl Warren
28c639e48b fix: sanitize network aliases to be valid DNS names (part 2) (#197)
- prefer the lowercase version of the DNS name which is more common they are case insensitive anyway
- fix the inverted information when sanitation happens

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/197
Reviewed-by: msrd0 <msrd0@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-26 11:31:05 +00:00
Gusted
b1ea5424b9 chore: enable staticcheck (#196)
Fix places where deprecated functions/types were used.

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/196
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-07-26 03:55:31 +00:00
Earl Warren
6e4a3b5127 fix: jobparser: do not crash on invalid workflow_{dispatch,call} (#193)
An invalid workflow_{dispatch,call} key with a type that is not a map may attempt to use a nil map. It happens randomly as the order of the key maps is not guaranteed. Without this fix, the tests will fail 100% of the time with:

`go test -count=500 -run=TestParseRawOn/on:___workflow_ -v ./pkg/jobparser/`

Regression from https://code.forgejo.org/forgejo/act/pulls/45

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/193
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-25 11:30:48 +00:00
Earl Warren
53e26e56b1 fix: sum256 the container name so derivations do not overflow (#191)
For instance, the volume name derived from the workflow name may exceed the file system limit when the container name it is derived from is too long.

Fixes forgejo/runner#152

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/191
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-25 09:44:25 +00:00
Earl Warren
7e1a84b400 fix: fails workflow validation if runs-on is missing (#192)
This created confusion when the interpretation of the absence of `runs-on` changed unexpectedly. Making it mandatory fixes this ambiguity.

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/192
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-24 05:22:06 +00:00
Earl Warren
2be7a6f1a5 fix: sanitize network aliases to be valid DNS names (#190)
- s/[^A-Z0-9-]/_/g
- add a log line in case the name is sanitized

Closes forgejo/runner#226

---

It is breaking because it will fail jobs that rely on service names that contain characters that are sanitized

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/190
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-22 07:54:10 +00:00
Earl Warren
4a8d6556c7 chore(cleanup): delete a network scheduled for deletion even if there is no service (#189)
In the current implementation, the network will only be created and be scheduled to be deleted when there is a service:

```go
func (rc *RunContext) networkName() (string, bool) {
	if len(rc.Run.Job().Services) > 0 || rc.Config.ContainerNetworkMode == "" {
		return fmt.Sprintf("%s-%s-network", rc.jobContainerName(), rc.Run.JobID), true
	}
	return string(rc.Config.ContainerNetworkMode), false
}
```

Therefore it does not currently make a difference. However, in case the network creation logic changes and a network is created even if a service is not present, it would be incorrect not to delete it.

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/189
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-22 06:08:31 +00:00
earl-warren
a157d24741 feat: use hashed uses string as cache dir name (#186)
Port of https://gitea.com/gitea/act/pulls/117

Refs forgejo/act#100

Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/186
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-07-21 21:08:46 +00:00
Earl Warren
13ed94f5b7 feat!: add the validate argument to reading workflows (#180)
This is a followup of https://code.forgejo.org/forgejo/act/pulls/170 so that it is possible to read a workflow without validation. It is not uncommon for Forgejo to read a workflow just to extract a few information from it, knowing it has been validated before. It would be a performance regression if schema validation happened in these cases.

This is a port of https://github.com/nektos/act/pull/2717/files

It is a breaking change in the context of Forgejo and Forgejo runner because it will need to add the new `validate` argument when reading workflows.

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/180
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-16 08:46:36 +00:00
Renovate Bot
a978a5ecc1 Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 [skip cascade] (#185)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [github.com/golangci/golangci-lint/cmd/golangci-lint](https://github.com/golangci/golangci-lint) | `v1.62.2` -> `v2.2.2` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgolangci%2fgolangci-lint%2fcmd%2fgolangci-lint/v2.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgolangci%2fgolangci-lint%2fcmd%2fgolangci-lint/v1.62.2/v2.2.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>golangci/golangci-lint (github.com/golangci/golangci-lint/cmd/golangci-lint)</summary>

### [`v2.2.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v222)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.2.1...v2.2.2)

1. Linters bug fixes
   - `noinlineerr`: from 1.0.3 to 1.0.4
2. Documentation
   - Improve debug keys documentation
3. Misc.
   - fix: panic close of closed channel
   - godot: add noinline value into the JSONSchema

### [`v2.2.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v221)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.2.0...v2.2.1)

1. Linters bug fixes

- `varnamelen`: fix configuration

### [`v2.2.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v220)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.6...v2.2.0)

1. New linters
   - Add `arangolint` linter https://github.com/Crocmagnon/arangolint
   - Add `embeddedstructfieldcheck` linter https://github.com/manuelarte/embeddedstructfieldcheck
   - Add `noinlineerr` linter https://github.com/AlwxSin/noinlineerr
   - Add `swaggo` formatter https://github.com/golangci/swaggoswag
2. Linters new features or changes
   - `errcheck`: add `verbose` option
   - `funcorder`: from 0.2.1 to 0.5.0 (new option `alphabetical`)
   - `gomoddirectives`: from 0.6.1 to 0.7.0 (new option `ignore-forbidden`)
   - `iface`: from 1.3.1 to 1.4.0 (new option `unexported`)
   - `noctx`: from 0.1.0 to 0.3.3 (new report messages, and new rules related to `database/sql`)
   - `noctx`: from 0.3.3 to 0.3.4 (new SQL functions detection)
   - `revive`: from 1.9.0 to 1.10.0 (new rules: `time-date`, `unnecessary-format`, `use-fmt-print`)
   - `usestdlibvars`: from 1.28.0 to 1.29.0 (new option `time-date-month`)
   - `wsl`: deprecation
   - `wsl_v5`: from 4.7.0 to 5.0.0 (major version with new configuration)
3. Linters bug fixes
   - `dupword`: from 0.1.3 to 0.1.6
   - `exptostd`: from 0.4.3 to 0.4.4
   - `forbidigo`: from 1.6.0 to 2.1.0
   - `gci`: consistently format the code
   - `go-spancheck`: from 0.6.4 to 0.6.5
   - `goconst`: from 1.8.1 to 1.8.2
   - `gosec`: from 2.22.3 to 2.22.4
   - `gosec`: from 2.22.4 to 2.22.5
   - `makezero`: from 1.2.0 to 2.0.1
   - `misspell`: from 0.6.0 to 0.7.0
   - `usetesting`: from 0.4.3 to 0.5.0
4. Misc.
   - exclusions:  fix `path-expect`
   - formatters: write the input to `stdout` when using `stdin` and there are no changes
   - migration: improve the error message when trying to migrate a migrated config
   - `typecheck`: deduplicate errors
   - `typecheck`: stops the analysis after the first error
   - Deprecate `print-resources-usage` flag
   - Unique version per custom build
5. Documentation
   - Improves typecheck FAQ
   - Adds plugin systems recommendations
   - Add description for `linters.default` sets

### [`v2.1.6`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v216)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.5...v2.1.6)

1. Linters bug fixes
   - `godot`: from 1.5.0 to 1.5.1
   - `musttag`: from 0.13.0 to 0.13.1
2. Documentation
   - Add note about golangci-lint v2 integration in VS Code

### [`v2.1.5`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v215)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.4...v2.1.5)

Due to an error related to Snapcraft, some artifacts of the v2.1.4 release have not been published.

This release contains the same things as v2.1.3.

### [`v2.1.4`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v214)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.3...v2.1.4)

Due to an error related to Snapcraft, some artifacts of the v2.1.3 release have not been published.

This release contains the same things as v2.1.3.

### [`v2.1.3`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v213)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.2...v2.1.3)

1. Linters bug fixes
   - `fatcontext`: from 0.7.2 to 0.8.0
2. Misc.
   - migration: fix `nakedret.max-func-lines: 0`
   - migration: fix order of `staticcheck` settings
   - fix: add `go.mod` hash to the cache salt
   - fix: use diagnostic position for related information position

### [`v2.1.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v212)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.1...v2.1.2)

1. Linters bug fixes
   - `exptostd`: from 0.4.2 to 0.4.3
   - `gofumpt`: from 0.7.0 to 0.8.0
   - `protogetter`: from 0.3.13 to 0.3.15
   - `usetesting`: from 0.4.2 to 0.4.3

### [`v2.1.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v211)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.1.0...v2.1.1)

The release process of v2.1.0 failed due to a regression inside goreleaser.

The binaries of v2.1.0 have been published, but not the other artifacts (AUR, Docker, etc.).

### [`v2.1.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v210)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.0.2...v2.1.0)

1. Enhancements
   - Add an option to display absolute paths (`--path-mode=abs`)
   - Add configuration path placeholder (`${config-path}`)
   - Add `warn-unused` option for `fmt` command
   - Colored diff for `fmt` command (`golangci-lint fmt --diff-colored`)
2. New linters
   - Add `funcorder` linter https://github.com/manuelarte/funcorder
3. Linters new features or changes
   - `go-errorlint`: from 1.7.1 to 1.8.0 (automatic error comparison and type assertion fixes)
   - ⚠️ `goconst`: `ignore-strings` is deprecated and replaced by `ignore-string-values`
   - `goconst`: from 1.7.1 to 1.8.1 (new options: `find-duplicates`, `eval-const-expressions`)
   - `govet`: add `httpmux` analyzer
   - `nilnesserr`: from 0.1.2 to 0.2.0 (detect more cases)
   - `paralleltest`: from 1.0.10 to 1.0.14 (checks only `_test.go` files)
   - `revive`: from 1.7.0 to 1.9.0 (support kebab case for setting names)
   - `sloglint`: from 0.9.0 to 0.11.0 (autofix, new option `msg-style`, suggest `slog.DiscardHandler`)
   - `wrapcheck`: from 2.10.0 to 2.11.0 (new option `report-internal-errors`)
   - `wsl`: from 4.6.0 to 4.7.0 (cgo files are always excluded)
4. Linters bug fixes
   - `fatcontext`: from 0.7.1 to 0.7.2
   - `gocritic`: fix `importshadow` checker
   - `gosec`: from 2.22.2 to 2.22.3
   - `ireturn`: from 0.3.1 to 0.4.0
   - `loggercheck`: from 0.10.1 to 0.11.0
   - `nakedret`: from 2.0.5 to 2.0.6
   - `nonamedreturns`: from 1.0.5 to 1.0.6
   - `protogetter`: from 0.3.12 to 0.3.13
   - `testifylint`: from 1.6.0 to 1.6.1
   - `unconvert`: update to HEAD
5. Misc.
   - Fixes memory leaks when using go1.(N) with golangci-lint built with go1.(N-X)
   - Adds `golangci-lint-fmt` pre-commit hook
6. Documentation
   - Improvements
   - Updates section about vscode integration

### [`v2.0.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v202)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.0.1...v2.0.2)

1. Misc.
   - Fixes flags parsing for formatters
   - Fixes the filepath used by the exclusion `source` option
2. Documentation
   - Adds a section about flags migration
   - Cleaning pages with v1 options

### [`v2.0.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v201)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v2.0.0...v2.0.1)

1. Linters/formatters bug fixes
   - `golines`: fix settings during linter load
2. Misc.
   - Validates the `version` field before the configuration
   - `forbidigo`: fix migration

### [`v2.0.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v200)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.8...v2.0.0)

1. Enhancements
   - 🌟 New `golangci-lint fmt` command with dedicated [formatter configuration](https://golangci-lint.run/welcome/quick-start/#formatting)
   - ♻️ New `golangci-lint migrate` command to help migration from v1 to v2 (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#command-migrate))
   - ⚠️ New default values (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/))
   - ⚠️ No exclusions by default (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#issuesexclude-use-default))
   - ⚠️ New default sort order (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#outputsort-order))
   - 🌟 New option `run.relative-path-mode` (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#runrelative-path-mode))
   - 🌟 New linters configuration (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#linters))
   - 🌟 New output format configuration (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#output))
   - 🌟 New `--fast-only` flag (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#lintersfast))
   - 🌟 New option `linters.exclusions.warn-unused` to log a warning if an exclusion rule is unused.
2. New linters/formatters
   - Add `golines` formatter https://github.com/segmentio/golines
3. Linters new features
   - ⚠️ Merge `staticcheck`, `stylecheck`, `gosimple` into one linter (`staticcheck`) (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#lintersenablestylecheckgosimplestaticcheck))
   - `go-critic`: from 0.12.0 to 0.13.0
   - `gomodguard`: from 1.3.5 to 1.4.1 (block explicit indirect dependencies)
   - `nilnil`: from 1.0.1 to 1.1.0 (new option: `only-two`)
   - `perfsprint`: from 0.8.2 to 0.9.1 (checker name in the diagnostic message)
   - `staticcheck`: new `quickfix` set of rules
   - `testifylint`: from 1.5.2 to 1.6.0 (new options: `equal-values`, `suite-method-signature`, `require-string-msg`)
   - `wsl`: from 4.5.0 to 4.6.0 (new option: `allow-cuddle-used-in-block`)
4. Linters bug fixes
   - `bidichk`: from 0.3.2 to 0.3.3
   - `errchkjson`: from 0.4.0 to 0.4.1
   - `errname`: from 1.0.0 to 1.1.0
   - `funlen`: fix `ignore-comments` option
   - `gci`: from 0.13.5 to 0.13.6
   - `gosmopolitan`: from 1.2.2 to 1.3.0
   - `inamedparam`: from 0.1.3 to 0.2.0
   - `intrange`: from 0.3.0 to 0.3.1
   - `protogetter`: from 0.3.9 to 0.3.12
   - `unparam`: from [`8a5130c`](8a5130ca72) to [`0df0534`](0df0534333)
5. Misc.
   - 🧹 Configuration options renaming (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/))
   - 🧹 Remove options (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/))
   - 🧹 Remove flags (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/))
   - 🧹 Remove alternative names (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/#alternative-linter-names))
   - 🧹 Remove or replace deprecated elements (cf. [Migration guide](https://golangci-lint.run/product/migration-guide/))
   - Adds an option to display some commands as JSON:
     - `golangci-lint config path --json`
     - `golangci-lint help linters --json`
     - `golangci-lint help formatters --json`
     - `golangci-lint linters --json`
     - `golangci-lint formatters --json`
     - `golangci-lint version --json`
6. Documentation
   - [Migration guide](https://golangci-lint.run/product/migration-guide/)

### [`v1.64.8`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1648)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.7...v1.64.8)

- Detects use of configuration files from golangci-lint v2

### [`v1.64.7`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1647)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.6...v1.64.7)

1. Linters bug fixes
   - `depguard`: from 2.2.0 to 2.2.1
   - `dupl`: from [`3e9179a`](3e9179ac44) to [`f665c8d`](f665c8d69b)
   - `gosec`: from 2.22.1 to 2.22.2
   - `staticcheck`: from 0.6.0 to 0.6.1
2. Documentation
   - Add GitLab documentation

### [`v1.64.6`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1646)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.5...v1.64.6)

1. Linters bug fixes
   - `asciicheck`: from 0.4.0 to 0.4.1
   - `contextcheck`: from 1.1.5 to 1.1.6
   - `errcheck`: from 1.8.0 to 1.9.0
   - `exptostd`: from 0.4.1 to 0.4.2
   - `ginkgolinter`: from 0.19.0 to 0.19.1
   - `go-exhaustruct`: from 3.3.0 to 3.3.1
   - `gocheckcompilerdirectives`: from 1.2.1 to 1.3.0
   - `godot`: from 1.4.20 to 1.5.0
   - `perfsprint`: from 0.8.1 to 0.8.2
   - `revive`: from 1.6.1 to 1.7.0
   - `tagalign`: from 1.4.1 to 1.4.2

### [`v1.64.5`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1645)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.4...v1.64.5)

1. Bug fixes
   - Add missing flag `new-from-merge-base-flag`
2. Linters bug fixes
   - `asciicheck`: from 0.3.0 to 0.4.0
   - `forcetypeassert`: from 0.1.0 to 0.2.0
   - `gosec`: from 2.22.0 to 2.22.1

### [`v1.64.4`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1644)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.3...v1.64.4)

1. Linters bug fixes
   - `gci`: fix standard packages list for go1.24

### [`v1.64.3`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1643)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.2...v1.64.3)

1. Linters bug fixes
   - `ginkgolinter`: from 0.18.4 to 0.19.0
   - `go-critic`: from 0.11.5 to 0.12.0
   - `revive`: from 1.6.0 to 1.6.1
   - `gci`: fix standard packages list for go1.24
2. Misc.
   - Build Docker images with go1.24

### [`v1.64.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1642)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.1...v1.64.2)

This is the last minor release of golangci-lint v1.
The next release will be golangci-lint [v2](https://github.com/golangci/golangci-lint/issues/5300).

1. Enhancements
   - 🎉 go1.24 support
   - New `issues.new-from-merge-base` option
   - New `run.relative-path-mode` option
2. Linters new features
   - `copyloopvar`: from 1.1.0 to 1.2.1 (support suggested fixes)
   - `exptostd`: from 0.3.1 to 0.4.1 (handles `golang.org/x/exp/constraints.Ordered`)
   - `fatcontext`: from 0.5.3 to 0.7.1 (new option: `check-struct-pointers`)
   - `perfsprint`: from 0.7.1 to 0.8.1 (new options: `integer-format`, `error-format`, `string-format`, `bool-format`, and `hex-format`)
   - `revive`: from 1.5.1 to 1.6.0 (new rules: `redundant-build-tag`, `use-errors-new`. New option `early-return.early-return`)
3. Linters bug fixes
   - `go-errorlint`: from 1.7.0 to 1.7.1
   - `gochecknoglobals`: from 0.2.1 to 0.2.2
   - `godox`: from [`006bad1`](006bad1f9d) to 1.1.0
   - `gosec`: from 2.21.4 to 2.22.0
   - `iface`: from 1.3.0 to 1.3.1
   - `nilnesserr`: from 0.1.1 to 0.1.2
   - `protogetter`: from 0.3.8 to 0.3.9
   - `sloglint`: from 0.7.2 to 0.9.0
   - `spancheck`: fix default `StartSpanMatchersSlice` values
   - `staticcheck`: from 0.5.1 to 0.6.0
4. Deprecations
   - ⚠️ `tenv` is deprecated and replaced by `usetesting.os-setenv: true`.
   - ⚠️ `exportloopref` deprecation step 2
5. Misc.
   - Sanitize severities by output format
   - Avoid panic with plugin without description
6. Documentation
   - Clarify `depguard` configuration

### [`v1.64.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1641)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.0...v1.64.1)

Cancelled due to CI failure.

### [`v1.64.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1640)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.4...v1.64.0)

Cancelled due to CI failure.

### [`v1.63.4`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1634)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.3...v1.63.4)

1. Linters bug fixes
   - `dupl`, `gomodguard`, `revive`: keep only Go-files.

### [`v1.63.3`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1633)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.2...v1.63.3)

1. Linters bug fixes
   - `gofmt`, `gofumpt`, `goimports`, `gci`: panic with several trailing EOL
   - `goheader`: skip issues with invalid positions

### [`v1.63.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1632)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.1...v1.63.2)

1. Linters bug fixes
   - `gofmt`, `gofumpt`, `goimports`, `gci`: panic with missing trailing EOL

### [`v1.63.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1631)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.0...v1.63.1)

1. Linters bug fixes
   - `cgi`: invalid reports with cgo
   - `gofumpt`: panic with autofix and cgo

### [`v1.63.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1630)

[Compare Source](https://github.com/golangci/golangci-lint/compare/v1.62.2...v1.63.0)

1. Enhancements
   - Add support for SuggestedFixes 🎉 (35 linters can "autofix" reports).
   - Formatters (`gofmt`, `goimports`, `gofumpt`, `gci`) are applied after the suggested fixes.
2. New linters
   - Add `exptostd` linter https://github.com/ldez/exptostd
   - Add `nilnesserr` linter https://github.com/alingse/nilnesserr
   - Add `usetesting` linter https://github.com/ldez/usetesting
3. Linters new features
   - `gci`: new options: `no-inline-comments`, `no-prefix-comments`
   - `gomoddirectives`: from 0.2.4 to 0.6.0 (new options: `go-version-pattern`, `toolchain-pattern`,`toolchain-forbidden`, `tool-forbidden`, `go-debug-forbidden`)
   - `govet`: new `stdversion`, `waitgroup` analyzers
   - `importas`: allow multiple empty aliases
   - `loggercheck`: new `slog` option
   - `recvcheck`: from 0.1.2 to 0.2.0 (new options: `disable-builtin`, `exclusions`)
   - `tagliatelle`: from 0.5.0 to 0.7.1 (new options: `ignored-fields`, `extended-rules`,`overrides`, `pkg`, `ignore`)
   - `usestdlibvars`: from 1.27.0 to 1.28.0 (autofix)
   - `wrapcheck`: from 2.9.0 to 2.10.0 (new option: `extra-ignore-sigs`)
4. Linters bug fixes
   - `asciicheck`: from 0.2.0 to 0.3.0
   - `bodyclose`: from [`5742072`](5742072509) to [`ed6a65f`](ed6a65f985)
   - `funlen`: from 0.1.0 to 0.2.0
   - `ginkgolinter`: from 0.18.3 to 0.18.4
   - `gochecksumtype`: from 0.2.0 to 0.3.1
   - `gocognit`: from 1.1.3 to 1.2.0
   - `godot`: from 1.4.18 to 1.4.20
   - `goheader`: report position improvement
   - `gosec`: handling of global nosec option when it is false
   - `iface`: from 1.2.1 to 1.3.0
   - `importas`: from 0.1.0 to 0.2.0
   - `intrange`: from 0.2.1 to 0.3.0
   - `makezero`: from 1.1.1 to 1.2.0
   - `mirror`: from 1.2.0 to 1.3.0
   - `nilnil`: from 1.0.0 to 1.0.1
   - `nosprintfhostport`: from 0.1.1 to 0.2.0
   - `reassign`: from 0.2.0 to 0.3.0
   - `spancheck`: from 0.6.2 to 0.6.4
   - `tagalign`: from 1.3.4 to 1.4.1
   - `wastedassign`: from 2.0.7 to 2.1.0
   - `whitespace`: from 0.1.1 to 0.2.0
   - `wsl`: from 4.4.1 to 4.5.0
5. Deprecations
   - ⚠️ `output.uniq-by-line` is deprecated and replaced by `issues.uniq-by-line`.
6. Misc.
   - Improvements of the help command (color and JSON support).
   - Removes `decoder`, `sloglint`, `tagalign` from `format` preset.
   - Enables paths with junction inside Windows.
   - The timeout is disabled if `run.timeout` <= 0.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4zMi4xIiwidXBkYXRlZEluVmVyIjoiNDEuMzIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/185
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-07-16 06:52:51 +00:00
Earl Warren
c2f91f63df fix: image credentials for services must not override container image credentials (#181)
- do not override username and password when looping over services
- split prepareJobContainer out of startJobContainer
- split getNetworkName out as it is used by both
- add unit tests for prepareJobContainer
- make containre.NewContainer mockable
- add MockVariable helper

Closes forgejo/runner#575

---

Note to reviewers: do not show whitespace change, the refactor will show in  a minimal way. When the fix is reverted the tests fail as follows:

```
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -81,4 +81,4 @@
        	            	   Image: (string) (len=10) "some:image",
        	            	-  Username: (string) (len=17) "containerusername",
        	            	-  Password: (string) (len=17) "containerpassword",
        	            	+  Username: (string) (len=16) "service2username",
        	            	+  Password: (string) (len=16) "service2password",
        	            	   Entrypoint: ([]string) (len=3) {
        	Test:       	TestStartJobContainer/Overlapping
```

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/181
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-15 20:55:38 +00:00