Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/frantjc/forge
Browse files Browse the repository at this point in the history
  • Loading branch information
frantjc committed Feb 1, 2025
2 parents 34e00fe + 671353d commit 5d2e70e
Show file tree
Hide file tree
Showing 12 changed files with 269 additions and 333 deletions.
258 changes: 110 additions & 148 deletions .github/actions/setup-forge/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/setup-forge/dist/index.js.map

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions .github/actions/setup-forge/dist/licenses.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions .github/actions/setup-forge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-forge",
"version": "0.15.4",
"version": "0.15.5",
"private": true,
"scripts": {
"all": "npm-run-all fmt build",
Expand All @@ -22,12 +22,12 @@
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/tool-cache": "^2.0.1",
"@actions/tool-cache": "^2.0.2",
"yaml": "^2.7.0"
},
"devDependencies": {
"@types/node": "^22.10.5",
"@typescript-eslint/parser": "^8.19.1",
"@types/node": "^22.10.10",
"@typescript-eslint/parser": "^8.21.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^8.57.1",
"eslint-plugin-github": "^5.1.5",
Expand Down
84 changes: 39 additions & 45 deletions .github/actions/setup-forge/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==

"@actions/core@^1.11.1", "@actions/core@^1.2.6":
"@actions/core@^1.11.1":
version "1.11.1"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.11.1.tgz#ae683aac5112438021588030efb53b1adb86f172"
integrity sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==
Expand All @@ -34,17 +34,16 @@
resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71"
integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==

"@actions/tool-cache@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@actions/tool-cache/-/tool-cache-2.0.1.tgz#8a649b9c07838d9d750c9864814e66a7660ab720"
integrity sha512-iPU+mNwrbA8jodY8eyo/0S/QqCKDajiR8OxWTnSk/SnYg0sj8Hp4QcUEVC1YFpHWXtrfbQrE13Jz4k4HXJQKcA==
"@actions/tool-cache@^2.0.2":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@actions/tool-cache/-/tool-cache-2.0.2.tgz#49ff20b0352aeac5411988e88435e47144fabb3e"
integrity sha512-fBhNNOWxuoLxztQebpOaWu6WeVmuwa77Z+DxIZ1B+OYvGkGQon6kTVg6Z32Cb13WCuw0szqonK+hh03mJV7Z6w==
dependencies:
"@actions/core" "^1.2.6"
"@actions/core" "^1.11.1"
"@actions/exec" "^1.0.0"
"@actions/http-client" "^2.0.1"
"@actions/io" "^1.1.1"
semver "^6.1.0"
uuid "^3.3.2"

"@ampproject/remapping@^2.2.0":
version "2.2.1"
Expand Down Expand Up @@ -852,10 +851,10 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==

"@types/node@*", "@types/node@^22.10.5":
version "22.10.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b"
integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==
"@types/node@*", "@types/node@^22.10.10":
version "22.10.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.10.tgz#85fe89f8bf459dc57dfef1689bd5b52ad1af07e6"
integrity sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==
dependencies:
undici-types "~6.20.0"

Expand Down Expand Up @@ -917,15 +916,15 @@
"@typescript-eslint/visitor-keys" "8.15.0"
debug "^4.3.4"

"@typescript-eslint/parser@^8.0.0", "@typescript-eslint/parser@^8.19.1":
version "8.19.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.19.1.tgz#b836fcfe7a704c8c65f5a50e5b0ff8acfca5c21b"
integrity sha512-67gbfv8rAwawjYx3fYArwldTQKoYfezNUT4D5ioWetr/xCrxXxvleo3uuiFuKfejipvq+og7mjz3b0G2bVyUCw==
"@typescript-eslint/parser@^8.0.0", "@typescript-eslint/parser@^8.21.0":
version "8.21.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.21.0.tgz#312c638aaba4f640d45bfde7c6795a9d75deb088"
integrity sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==
dependencies:
"@typescript-eslint/scope-manager" "8.19.1"
"@typescript-eslint/types" "8.19.1"
"@typescript-eslint/typescript-estree" "8.19.1"
"@typescript-eslint/visitor-keys" "8.19.1"
"@typescript-eslint/scope-manager" "8.21.0"
"@typescript-eslint/types" "8.21.0"
"@typescript-eslint/typescript-estree" "8.21.0"
"@typescript-eslint/visitor-keys" "8.21.0"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
Expand All @@ -944,13 +943,13 @@
"@typescript-eslint/types" "8.16.0"
"@typescript-eslint/visitor-keys" "8.16.0"

"@typescript-eslint/scope-manager@8.19.1":
version "8.19.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.19.1.tgz#794cfc8add4f373b9cd6fa32e367e7565a0e231b"
integrity sha512-60L9KIuN/xgmsINzonOcMDSB8p82h95hoBfSBtXuO4jlR1R9L1xSkmVZKgCPVfavDlXihh4ARNjXhh1gGnLC7Q==
"@typescript-eslint/scope-manager@8.21.0":
version "8.21.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.21.0.tgz#d08d94e2a34b4ccdcc975543c25bb62917437500"
integrity sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==
dependencies:
"@typescript-eslint/types" "8.19.1"
"@typescript-eslint/visitor-keys" "8.19.1"
"@typescript-eslint/types" "8.21.0"
"@typescript-eslint/visitor-keys" "8.21.0"

"@typescript-eslint/[email protected]":
version "8.15.0"
Expand Down Expand Up @@ -982,10 +981,10 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.16.0.tgz#49c92ae1b57942458ab83d9ec7ccab3005e64737"
integrity sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==

"@typescript-eslint/types@8.19.1":
version "8.19.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.19.1.tgz#015a991281754ed986f2e549263a1188d6ed0a8c"
integrity sha512-JBVHMLj7B1K1v1051ZaMMgLW4Q/jre5qGK0Ew6UgXz1Rqh+/xPzV1aW581OM00X6iOfyr1be+QyW8LOUf19BbA==
"@typescript-eslint/types@8.21.0":
version "8.21.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.21.0.tgz#58f30aec8db8212fd886835dc5969cdf47cb29f5"
integrity sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==

"@typescript-eslint/[email protected]":
version "8.15.0"
Expand Down Expand Up @@ -1015,13 +1014,13 @@
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/typescript-estree@8.19.1":
version "8.19.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.1.tgz#c1094bb00bc251ac76cf215569ca27236435036b"
integrity sha512-jk/TZwSMJlxlNnqhy0Eod1PNEvCkpY6MXOXE/WLlblZ6ibb32i2We4uByoKPv1d0OD2xebDv4hbs3fm11SMw8Q==
"@typescript-eslint/typescript-estree@8.21.0":
version "8.21.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.21.0.tgz#5ce71acdbed3b97b959f6168afba5a03c88f69a9"
integrity sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==
dependencies:
"@typescript-eslint/types" "8.19.1"
"@typescript-eslint/visitor-keys" "8.19.1"
"@typescript-eslint/types" "8.21.0"
"@typescript-eslint/visitor-keys" "8.21.0"
debug "^4.3.4"
fast-glob "^3.3.2"
is-glob "^4.0.3"
Expand Down Expand Up @@ -1065,12 +1064,12 @@
"@typescript-eslint/types" "8.16.0"
eslint-visitor-keys "^4.2.0"

"@typescript-eslint/visitor-keys@8.19.1":
version "8.19.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.1.tgz#fce54d7cfa5351a92387d6c0c5be598caee072e0"
integrity sha512-fzmjU8CHK853V/avYZAvuVut3ZTfwN5YtMaoi+X9Y9MA9keaWNHC3zEQ9zvyX/7Hj+5JkNyK1l7TOR2hevHB6Q==
"@typescript-eslint/visitor-keys@8.21.0":
version "8.21.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.21.0.tgz#a89744c4cdc83b5c761eb5878befe6c33d1481b2"
integrity sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==
dependencies:
"@typescript-eslint/types" "8.19.1"
"@typescript-eslint/types" "8.21.0"
eslint-visitor-keys "^4.2.0"

"@ungap/structured-clone@^1.2.0":
Expand Down Expand Up @@ -3966,11 +3965,6 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"

uuid@^3.3.2:
version "3.4.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==

v8-to-istanbul@^9.0.1:
version "9.1.0"
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: 1.23
- uses: golangci/golangci-lint-action@v6.1.1
- uses: golangci/golangci-lint-action@v6.2.0
- run: make download
- run: make test
- uses: goreleaser/goreleaser-action@v6
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BIN = /usr/local/bin
GOOS = $(shell $(GO) env GOOS)
GOARCH = $(shell $(GO) env GOARCH)

SEMVER ?= 0.15.4
SEMVER ?= 0.15.5

.DEFAULT: install

Expand Down Expand Up @@ -78,7 +78,8 @@ format: fmt
i: install
shims: shim_amd64 shim_arm64
shim: shim_$(GOARCH)
shim_$(GOARCH): internal/bin/shim_$(GOARCH) internal/bin/fs_$(GOARCH).go
shim_amd64: internal/bin/shim_amd64 internal/bin/fs_amd64.go
shim_arm64: internal/bin/shim_arm64 internal/bin/fs_arm64.go

.PHONY: .github/actions/setup-forge .github/actions/setup-forge/ action i install build fmt generate test download vendor verify lint shims shim shim_$(GOARCH) internal/bin/fs_$(GOARCH).go internal/bin/shim_$(GOARCH) clean gen dl ven ver format release

Expand Down
9 changes: 5 additions & 4 deletions forgeactions/action_metadata_to_container_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (m *Mapping) ActionToConfigs(globalContext *githubactions.GlobalContext, us

if actionMetadata != nil {
if actionMetadata.Runs != nil {
actionDir, err := m.UsesToActionDirectory(uses)
dir, err := m.UsesToRootDirectory(uses)
if err != nil {
return nil, err
}
Expand All @@ -28,9 +28,10 @@ func (m *Mapping) ActionToConfigs(globalContext *githubactions.GlobalContext, us
entrypoint = []string{}
env = append(envconv.MapToArr(environment), envconv.MapToArr(actionMetadata.Runs.Env)...)
cmd = actionMetadata.Runs.Args
actionPath = filepath.Join(m.ActionPath, uses.GetActionPath())
mounts = []forge.Mount{
{
Source: actionDir,
Source: dir,
Destination: m.ActionPath,
},
{
Expand All @@ -51,11 +52,11 @@ func (m *Mapping) ActionToConfigs(globalContext *githubactions.GlobalContext, us
entrypoint = []string{"node"}

if pre := actionMetadata.Runs.Pre; pre != "" {
entrypoints = append(entrypoints, []string{filepath.Join(m.ActionPath, pre)})
entrypoints = append(entrypoints, []string{filepath.Join(actionPath, pre)})
}

if main := actionMetadata.Runs.Main; main != "" {
entrypoints = append(entrypoints, []string{filepath.Join(m.ActionPath, main)})
entrypoints = append(entrypoints, []string{filepath.Join(actionPath, main)})
}
case githubactions.RunsUsingDocker:
if pre := actionMetadata.Runs.PreEntrypoint; pre != "" {
Expand Down
57 changes: 29 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ toolchain go1.23.4

require (
github.com/adrg/xdg v0.5.3
github.com/docker/cli v27.4.1+incompatible
github.com/docker/docker v27.4.1+incompatible
github.com/docker/cli v27.5.0+incompatible
github.com/docker/docker v27.5.1+incompatible
github.com/frantjc/x v0.0.0-20240409062121-4f11680e2399
github.com/go-git/go-git/v5 v5.13.0
github.com/google/go-containerregistry v0.20.2
github.com/go-git/go-git/v5 v5.13.2
github.com/google/go-containerregistry v0.20.3
github.com/google/go-github/v50 v50.2.0
github.com/google/uuid v1.6.0
github.com/moby/term v0.5.2
Expand All @@ -19,9 +19,9 @@ require (
github.com/spf13/cobra v1.8.1
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
golang.org/x/text v0.21.0
k8s.io/apimachinery v0.32.0
k8s.io/cli-runtime v0.32.0
k8s.io/client-go v0.32.0
k8s.io/apimachinery v0.32.1
k8s.io/cli-runtime v0.32.1
k8s.io/client-go v0.32.1
sigs.k8s.io/yaml v1.4.0
)

Expand All @@ -30,20 +30,20 @@ require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.1.3 // indirect
github.com/ProtonMail/go-crypto v1.1.5 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/cyphar/filepath-securejoin v0.2.5 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.0 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -54,7 +54,7 @@ require (
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.17.8 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
Expand All @@ -65,30 +65,31 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skeema/knownhosts v1.3.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vbatts/tar-split v0.11.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.50.0 // indirect
go.opentelemetry.io/otel v1.25.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.25.0 // indirect
go.opentelemetry.io/otel/sdk v1.25.0 // indirect
go.opentelemetry.io/otel/trace v1.25.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/time v0.7.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
google.golang.org/grpc v1.68.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
Expand Down
Loading

0 comments on commit 5d2e70e

Please sign in to comment.