1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-31 18:30:58 +00:00
Commit graph

159 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Earl Warren
6620cc1d18 fix: allow overriding RUNNER_TOOL_CACHE from the config file (#178)
- rc.getToolCache(ctx) is used to figure out RUNNER_TOOL_CACHE and  returns RUNNER_TOOL_CACHE if it is found in the runner config, e.g.
  ```yaml
  container:
    env:
	  RUNNER_TOOL_CACHE: /srv/toolcache
  ```
- store the value in the new `toolCache` data member for containers,  in the same way it is done for host
- GetRunnerContext for containers return `toolCache` instead of a  hard coded string
- add integration test

Closes forgejo/runner#184

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/178
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-13 21:55:02 +00:00
Renovate Bot
ab012fec87 Update module github.com/docker/cli to v28 (#147)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/docker/cli](https://github.com/docker/cli) | require | major | `v25.0.7+incompatible` -> `v28.2.2+incompatible` |

---

### Release Notes

<details>
<summary>docker/cli (github.com/docker/cli)</summary>

### [`v28.2.2+incompatible`](https://github.com/docker/cli/compare/v28.2.1...v28.2.2)

[Compare Source](https://github.com/docker/cli/compare/v28.2.1...v28.2.2)

### [`v28.2.1+incompatible`](https://github.com/docker/cli/compare/v28.2.0...v28.2.1)

[Compare Source](https://github.com/docker/cli/compare/v28.2.0...v28.2.1)

### [`v28.2.0+incompatible`](https://github.com/docker/cli/compare/v28.1.1...v28.2.0)

[Compare Source](https://github.com/docker/cli/compare/v28.1.1...v28.2.0)

### [`v28.1.1+incompatible`](https://github.com/docker/cli/compare/v28.1.0...v28.1.1)

[Compare Source](https://github.com/docker/cli/compare/v28.1.0...v28.1.1)

### [`v28.1.0+incompatible`](https://github.com/docker/cli/compare/v28.0.4...v28.1.0)

[Compare Source](https://github.com/docker/cli/compare/v28.0.4...v28.1.0)

### [`v28.0.4+incompatible`](https://github.com/docker/cli/compare/v28.0.3...v28.0.4)

[Compare Source](https://github.com/docker/cli/compare/v28.0.3...v28.0.4)

### [`v28.0.3+incompatible`](https://github.com/docker/cli/compare/v28.0.2...v28.0.3)

[Compare Source](https://github.com/docker/cli/compare/v28.0.2...v28.0.3)

### [`v28.0.2+incompatible`](https://github.com/docker/cli/compare/v28.0.1...v28.0.2)

[Compare Source](https://github.com/docker/cli/compare/v28.0.1...v28.0.2)

### [`v28.0.1+incompatible`](https://github.com/docker/cli/compare/v28.0.0...v28.0.1)

[Compare Source](https://github.com/docker/cli/compare/v28.0.0...v28.0.1)

### [`v28.0.0+incompatible`](https://github.com/docker/cli/compare/v27.5.1...v28.0.0)

[Compare Source](https://github.com/docker/cli/compare/v27.5.1...v28.0.0)

### [`v27.5.1+incompatible`](https://github.com/docker/cli/compare/v27.5.0...v27.5.1)

[Compare Source](https://github.com/docker/cli/compare/v27.5.0...v27.5.1)

### [`v27.5.0+incompatible`](https://github.com/docker/cli/compare/v27.4.1...v27.5.0)

[Compare Source](https://github.com/docker/cli/compare/v27.4.1...v27.5.0)

### [`v27.4.1+incompatible`](https://github.com/docker/cli/compare/v27.4.0...v27.4.1)

[Compare Source](https://github.com/docker/cli/compare/v27.4.0...v27.4.1)

### [`v27.4.0+incompatible`](https://github.com/docker/cli/compare/v27.3.1...v27.4.0)

[Compare Source](https://github.com/docker/cli/compare/v27.3.1...v27.4.0)

### [`v27.3.1+incompatible`](https://github.com/docker/cli/compare/v27.3.0...v27.3.1)

[Compare Source](https://github.com/docker/cli/compare/v27.3.0...v27.3.1)

### [`v27.3.0+incompatible`](https://github.com/docker/cli/compare/v27.2.1...v27.3.0)

[Compare Source](https://github.com/docker/cli/compare/v27.2.1...v27.3.0)

### [`v27.2.1+incompatible`](https://github.com/docker/cli/compare/v27.2.0...v27.2.1)

[Compare Source](https://github.com/docker/cli/compare/v27.2.0...v27.2.1)

### [`v27.2.0+incompatible`](https://github.com/docker/cli/compare/v27.1.2...v27.2.0)

[Compare Source](https://github.com/docker/cli/compare/v27.1.2...v27.2.0)

### [`v27.1.2+incompatible`](https://github.com/docker/cli/compare/v27.1.1...v27.1.2)

[Compare Source](https://github.com/docker/cli/compare/v27.1.1...v27.1.2)

### [`v27.1.1+incompatible`](https://github.com/docker/cli/compare/v27.1.0...v27.1.1)

[Compare Source](https://github.com/docker/cli/compare/v27.1.0...v27.1.1)

### [`v27.1.0+incompatible`](https://github.com/docker/cli/compare/v27.0.3...v27.1.0)

[Compare Source](https://github.com/docker/cli/compare/v27.0.3...v27.1.0)

### [`v27.0.3+incompatible`](https://github.com/docker/cli/compare/v27.0.2...v27.0.3)

[Compare Source](https://github.com/docker/cli/compare/v27.0.2...v27.0.3)

### [`v27.0.2+incompatible`](https://github.com/docker/cli/compare/v27.0.1...v27.0.2)

[Compare Source](https://github.com/docker/cli/compare/v27.0.1...v27.0.2)

### [`v27.0.1+incompatible`](https://github.com/docker/cli/compare/v26.1.5...v27.0.1)

[Compare Source](https://github.com/docker/cli/compare/v26.1.5...v27.0.1)

### [`v26.1.5+incompatible`](https://github.com/docker/cli/compare/v26.1.4...v26.1.5)

[Compare Source](https://github.com/docker/cli/compare/v26.1.4...v26.1.5)

### [`v26.1.4+incompatible`](https://github.com/docker/cli/compare/v26.1.3...v26.1.4)

[Compare Source](https://github.com/docker/cli/compare/v26.1.3...v26.1.4)

### [`v26.1.3+incompatible`](https://github.com/docker/cli/compare/v26.1.2...v26.1.3)

[Compare Source](https://github.com/docker/cli/compare/v26.1.2...v26.1.3)

### [`v26.1.2+incompatible`](https://github.com/docker/cli/compare/v26.1.1...v26.1.2)

[Compare Source](https://github.com/docker/cli/compare/v26.1.1...v26.1.2)

### [`v26.1.1+incompatible`](https://github.com/docker/cli/compare/v26.1.0...v26.1.1)

[Compare Source](https://github.com/docker/cli/compare/v26.1.0...v26.1.1)

### [`v26.1.0+incompatible`](https://github.com/docker/cli/compare/v26.0.2...v26.1.0)

[Compare Source](https://github.com/docker/cli/compare/v26.0.2...v26.1.0)

### [`v26.0.2+incompatible`](https://github.com/docker/cli/compare/v26.0.1...v26.0.2)

[Compare Source](https://github.com/docker/cli/compare/v26.0.1...v26.0.2)

### [`v26.0.1+incompatible`](https://github.com/docker/cli/compare/v26.0.0...v26.0.1)

[Compare Source](https://github.com/docker/cli/compare/v26.0.0...v26.0.1)

### [`v26.0.0+incompatible`](https://github.com/docker/cli/compare/v25.0.7...v26.0.0)

[Compare Source](https://github.com/docker/cli/compare/v25.0.7...v26.0.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:eyJjcmVhdGVkSW5WZXIiOiI0MC40OC40IiwidXBkYXRlZEluVmVyIjoiNDAuNDguNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/147
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-06-14 10:19:53 +00:00
Renovate Bot
dea4525cec Update module github.com/docker/docker to v28 (#146)
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/146
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Renovate Bot <bot@kriese.eu>
Co-committed-by: Renovate Bot <bot@kriese.eu>
2025-06-11 14:57:23 +00:00
earl-warren
d90516fdc7 Merge pull request 'PR#6. [RDNF] fix: docker buildx cache restore not working, fix: function name in comment, fix: rootless permission bits (new actions cache)' (#122) from achyrva/act:nektos-into-forgejo-2 into main
Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/122
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
2025-05-26 05:15:49 +00:00
Michael Kriese
5e76fb3468 Use new distribution/reference import 2025-05-12 13:07:18 +02:00
ChristopherHX
868a1f9239 fix: rootless permission bits (new actions cache) (#2242)
* fix: rootless permission bits (new actions cache)

* add test

* fix lint / more tests

(cherry picked from commit d8fc9bade3403d72f4d5a47e103660b462630f48)
2025-04-24 09:02:07 +00:00
benniekiss
53de9c1c27 fix GOOS parsing to match expected GHA RUNNER_OS values (#106)
This PR is a carryover from [upstream](https://github.com/nektos/act/pull/2422):

> github actions reports RUNNER_OS for linux and windows with [capital letters](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/variables#default-environment-variables) (Linux, Windows). This should increase compatibility when runner uses `-self-hosted`
>
> Currently, when workflows are run within containers, RUNNER_OS is [hardcoded](https://code.forgejo.org/forgejo/act/search/branch/main?path=&q=RUNNER_OS&mode=exact) to `Linux` correctly, so this will make RUNNER_OS more consistent.

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/106
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: benniekiss <benniekiss@noreply.code.forgejo.org>
Co-committed-by: benniekiss <benniekiss@noreply.code.forgejo.org>
2025-03-31 07:52:49 +00:00
Earl Warren
e0facd1ee5 fix(tests): binds are not sorted
That creates false negative in test runs. Just keep one, there is no
value in having more.
2025-01-22 22:24:27 +01:00
Earl Warren
d92e4a8aff feat: --hostname is allowed in container options (#95)
It is useful to set an alternative hostname when running a service
such as:

```yaml
services:
  minio:
    image: data.forgejo.org/oci/bitnami/minio:2024.8.17
    options: >-
      --hostname alternate.minio
```

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/95
Reviewed-by: Kwonunn <kwonunn@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-22 18:22:29 +00:00
Earl Warren
ed911869e1 fix: filter job container options with an allow list
The workflow can only contain the following options for a container:

- --volume
- --tmpfs
2025-01-09 12:10:21 +01:00
Earl Warren
1a77a34726 chore(refactor): split parseOptions out of mergeContainerConfigs 2025-01-09 12:10:21 +01:00
Earl Warren
fc518884f9 chore(refactor): split Options into ConfigOptions & JobOptions
They are both command line options to be parsed as if provided to
docker-run, but they are not to be trusted in the same way.
2025-01-09 12:10:21 +01:00
Vitaliy Potyarkin
591770bf63 refactor: Improve logging of error messages
Logging bare errors might lead to long troubleshooting sessions when error
is not specific enough. This commit adds helpful context messages to
logged errors.

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2025-01-09 12:36:30 +03:00
Earl Warren
58966f5a8a chore(lint): fix lint errors
- upgrade to golangci-lint@v1.62.2
- make it renovate friendly
- remove most frequent lint check that are not of consequence (unused
  args, etc.)
- fix remaining lint errors
- add renovate custom manager to update the Makefile variable
2024-12-30 21:11:02 +00:00
Vitaliy Potyarkin
324188e239 fix: Do not fail on nil error
Commit 5a351d33df has introduced a
regression due to which copyDir() would fail after closing the archive
successfully

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-12-27 17:56:23 +03:00
Earl Warren
07c56a4032 chore(tests): add ./pkg/container tests
remove a failed test verifying exposed port which are not used in the
Forgejo runner anyway
2024-12-27 11:59:35 +01:00
Earl Warren
d544eb76a8 fix: debug is leaking host container and network names
Closes forgejo/runner#295
2024-10-19 08:48:50 +02:00
Tobias Bölz
6657ce2520 Fix NewDockerNetworkCreateExecutor in docker_stub 2024-04-03 13:55:42 +02:00
s3lph
0d8856b0ce [FORGEJO] feat(docker): Add flag to enable IPv6 in auto-created networks (#24)
Implements one part of forgejo/runner#119. The other part is a corresponding PR in forgejo/runner: forgejo/runner#120.

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/24
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: s3lph <codeberg@s3lph.me>
Co-committed-by: s3lph <codeberg@s3lph.me>
2024-03-11 17:10:33 +07:00
Earl Warren
4553d1750c [FORGEJO] implement lxc separately from self-hosted 2024-03-11 15:30:55 +07:00
Earl Warren
22f27b8bd8 [FORGEJO] wrap self-hosted platform steps in an LXC container
act PR https://github.com/nektos/act/pull/1682

* shell script to start the LXC container
* create and destroy a LXC container
* run commands with lxc-attach
* expose additional devices for docker & libvirt to work
* install node 16 & git for checkout to work

[FORGEJO] start/stop lxc working directory is /tmp

[FORGEJO] use lxc-helpers to create/destroy containers

[FORGEJO] do not setup LXC

(cherry picked from commit 5b94ff3226848791b93e72d2e0f0ee4bba29a989)

Conflicts:
	pkg/container/host_environment.go

Conflicts:
	pkg/container/host_environment.go

[FORGJEO] upgrade to node20
2024-03-11 15:23:41 +07:00
Chongyi Zheng
a7c4e92822 Merge branch 'nektos/master' into bump-nektos 2024-02-17 13:19:51 -05:00
ChristopherHX
5e0a9ffa53 refactor: filecollector into new package (#2174)
* refactor: filecollector into new package

* Add test for symlinks

* add test fix bug of GetContainerArchive

* add test data
2024-01-30 00:46:45 +00:00
Matthew
c358c37324 Add containerd's normalized architectures to archMapper (#2168) 2024-01-24 02:44:48 +00:00
ChristopherHX
57a16ab0f7 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
Leonardo Taccari
4485482c1f Add support for NetBSD (#2023)
NetBSD can run Docker CLI and then use Docker on some remote machine
via DOCKER_HOST.

(This can be probably extended to all other Unix-es capable of running
just Docker CLI.)

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
2024-01-08 19:26:03 +00:00
ChristopherHX
98afefd092 fix: IsHost is defined as false on windows (#2093)
* fix: IsHost is defined as false on windows

* Update docker_run.go

* Update docker_run.go
2023-12-16 14:46:17 -08:00
ChristopherHX
78a021bc14 fix: (#2075)
network-scoped alias is supported only for containers in user defined networks

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-11-12 18:09:25 +00:00
Jason Song
0fe2aa1cd9 fix: panic (#2071)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-11-04 14:10:53 +00:00
Jason Song
3322bc0cda fix: panic 2023-10-31 22:32:21 +08:00
Sam Foo
2de6a8e3aa Add support for service containers (#1949)
* Support services (#42)

Removed createSimpleContainerName and AutoRemove flag

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/act/pulls/42
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>

* Support services options (#45)

Reviewed-on: https://gitea.com/gitea/act/pulls/45
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>

* Support intepolation for `env` of `services` (#47)

Reviewed-on: https://gitea.com/gitea/act/pulls/47
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>

* Support services `credentials` (#51)

If a service's image is from a container registry requires authentication, `act_runner` will need `credentials` to pull the image, see [documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservicesservice_idcredentials).
Currently, `act_runner` incorrectly uses the `credentials` of `containers` to pull services' images and the `credentials` of services won't be used, see the related code: ba7ef95f06/pkg/runner/run_context.go (L228-L269)

Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/act/pulls/51
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>

* Add ContainerMaxLifetime and ContainerNetworkMode options

from: 1d92791718

* Fix container network issue (#56)

Follow: https://gitea.com/gitea/act_runner/pulls/184
Close https://gitea.com/gitea/act_runner/issues/177

- `act` create new networks only if the value of `NeedCreateNetwork` is true, and remove these networks at last. `NeedCreateNetwork` is passed by `act_runner`. 'NeedCreateNetwork' is true only if  `container.network` in the configuration file of the `act_runner` is empty.
- In the `docker create` phase, specify the network to which containers will connect. Because, if not specify , container will connect to `bridge` network which is created automatically by Docker.
  - If the network is user defined network ( the value of `container.network` is empty or `<custom-network>`.  Because, the network created by `act` is also user defined network.), will also specify alias by `--network-alias`. The alias of service is `<service-id>`. So we can be access service container by `<service-id>:<port>` in the steps of job.
- Won't try to `docker network connect ` network after `docker start` any more.
  - Because on the one hand,  `docker network connect` applies only to user defined networks, if try to `docker network connect host <container-name>` will return error.
  - On the other hand, we just specify network in the stage of `docker create`, the same effect can be achieved.
- Won't try to remove containers and networks berfore  the stage of `docker start`, because the name of these containers and netwoks won't be repeat.

Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/act/pulls/56
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: sillyguodong <gedong_1994@163.com>
Co-committed-by: sillyguodong <gedong_1994@163.com>

* Check volumes (#60)

This PR adds a `ValidVolumes` config. Users can specify the volumes (including bind mounts) that can be mounted to containers by this config.

Options related to volumes:
- [jobs.<job_id>.container.volumes](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontainervolumes)
- [jobs.<job_id>.services.<service_id>.volumes](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservicesservice_idvolumes)

In addition, volumes specified by `options` will also be checked.

Currently, the following default volumes (see f78a6206d3/pkg/runner/run_context.go (L116-L166)) will be added to `ValidVolumes`:
- `act-toolcache`
- `<container-name>` and `<container-name>-env`
- `/var/run/docker.sock` (We need to add a new configuration to control whether the docker daemon can be mounted)

Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/act/pulls/60
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>

* Remove ContainerMaxLifetime; fix lint

* Remove unused ValidVolumes

* Remove ConnectToNetwork

* Add docker stubs

* Close docker clients to prevent file descriptor leaks

* Fix the error when removing network in self-hosted mode (#69)

Fixes https://gitea.com/gitea/act_runner/issues/255

Reviewed-on: https://gitea.com/gitea/act/pulls/69
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>

* Move service container and network cleanup to rc.cleanUpJobContainer

* Add --network flag; default to host if not using service containers or set explicitly

* Correctly close executor to prevent fd leak

* Revert to tail instead of full path

* fix network duplication

* backport networkingConfig for aliaes

* don't hardcode netMode host

* Convert services test to table driven tests

* Add failing tests for services

* Expose service container ports onto the host

* Set container network mode in artifacts server test to host mode

* Log container network mode when creating/starting a container

* fix: Correctly handle ContainerNetworkMode

* fix: missing service container network

* Always remove service containers

Although we usually keep containers running if the workflow errored
(unless `--rm` is given) in order to facilitate debugging and we have
a flag (`--reuse`) to always keep containers running in order to speed
up repeated `act` invocations, I believe that these should only apply
to job containers and not service containers, because changing the
network settings on a service container requires re-creating it anyway.

* Remove networks only if no active endpoints exist

* Ensure job containers are stopped before starting a new job

* fix: go build -tags WITHOUT_DOCKER

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: sillyguodong <gedong_1994@163.com>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-authored-by: ZauberNerd <zaubernerd@zaubernerd.de>
2023-10-19 09:24:52 +00:00
techknowlogick
756db53bab Merge nektos/act/v0.2.51 2023-09-24 15:09:26 -04:00
Elian Doran
e94231487c Fix "Unknown server OS" for Docker container --device option (#1957)
The `--device` option would do platform-dependent validation, but the
OS was not passed as an argument. When a user added the `--device` option
to the container, it would result in a "Unknown server OS" error.
2023-08-09 18:21:05 +00:00
ChristopherHX
fd5b21b7be 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
ChristopherHX
093ca00002 feat: Add CopyTarStream to Container Interface (#1912)
* feat: CopyTarStream

Prepare for new process and thread safe action cache

* fix unused param

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-08-08 15:18:25 +00:00
ChristopherHX
1bd2c06f15 refactor: docker build BuildContext field (#1914)
The old Container input parameter was not flexible enough

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-08-08 15:02:11 +00:00
Jason Song
fc7b3c5c43 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
Casey Lee
d798d91d59 Bump dockercli (#1905)
* updates to support newer version of docker sdk

Bumps [github.com/docker/cli](https://github.com/docker/cli) from 24.0.2+incompatible to 24.0.4+incompatible.
- [Commits](https://github.com/docker/cli/compare/v24.0.2...v24.0.4)

---
updated-dependencies:
- dependency-name: github.com/docker/cli
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat: upgrade to go 1.20

* feat: upgrade to go 1.20

* chore: use go version from go.mod

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 21:55:53 -07:00
Casey Lee
28c6da4522 chore: upgrade golangci-lint and address findings (#1904) 2023-07-10 17:12:12 -07:00