chore: update configuration files and improve linting for Windows
Some checks failed
Codespell / Check for spelling errors (push) Has been cancelled
promote / promote (push) Has been cancelled

- Added `go1.24.0.linux-amd64.tar.gz` to `.gitignore`.
- Removed unnecessary newline in `.mergify.yml`.
- Updated `codecov.yml` to correct indentation for ignored files.
- Enhanced `Makefile` to support linting on Windows.
- Adjusted `.github/dependabot.yml` for proper indentation.
- Fixed string quotes in `.github/workflows/checks.yml`.
- Modified `pkg/container/util_windows.go` to ignore unused parameter.
- Updated error handling in `pkg/lookpath/lp_windows.go`.
- Refactored `pkg/runner/step_action_remote.go` to improve URL handling.
- Updated `pkg/runner/hashfiles/index.js` with significant changes for better performance and structure.
This commit is contained in:
2025-08-03 04:28:08 +07:00
parent bf8e52ba71
commit ed08d1dcb4
10 changed files with 5673 additions and 4730 deletions

View File

@@ -49,7 +49,7 @@ jobs:
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "unit-tests.xml"
paths: 'unit-tests.xml'
if: always()
- name: Run act from cli
run: go run main.go -P ubuntu-latest=node:16-buster-slim -C ./pkg/runner/testdata/ -W ./basic/push.yml
@@ -83,10 +83,9 @@ jobs:
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "unit-tests.xml"
paths: 'unit-tests.xml'
if: always()
snapshot:
name: snapshot
runs-on: ubuntu-latest

1
.gitignore vendored
View File

@@ -32,3 +32,4 @@ unit-tests.xml
# megalinter
report/
go1.24.0.linux-amd64.tar.gz

View File

@@ -1,4 +1,3 @@
pull_request_rules:
- name: warn on conflicts
conditions:

View File

@@ -53,11 +53,19 @@ lint-md:
.PHONY: lint-rest
lint-rest:
ifeq ($(OS),Windows_NT)
docker run --rm -it \
-v "$(shell cd):/tmp/lint" \
-e GITHUB_STATUS_REPORTER=false \
-e GITHUB_COMMENT_REPORTER=false \
megalinter/megalinter-go:v5
else
docker run --rm -it \
-v $(PWD):/tmp/lint \
-e GITHUB_STATUS_REPORTER=false \
-e GITHUB_COMMENT_REPORTER=false \
megalinter/megalinter-go:v5
endif
.PHONY: lint
lint: lint-go lint-rest

View File

@@ -9,5 +9,5 @@ coverage:
target: 50%
informational: true
ignore:
# Files generated by Google Protobuf do not require coverage
- '**/*.pb.go'
# Files generated by Google Protobuf do not require coverage
- '**/*.pb.go'

View File

@@ -6,7 +6,7 @@ import (
"syscall"
)
func getSysProcAttr(cmdLine string, tty bool) *syscall.SysProcAttr {
func getSysProcAttr(cmdLine string, _ bool) *syscall.SysProcAttr {
return &syscall.SysProcAttr{CmdLine: cmdLine, CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP}
}

View File

@@ -77,9 +77,8 @@ func LookPath2(file string, lenv Env) (string, error) {
if strings.ContainsAny(file, `:\/`) {
if f, err := findExecutable(file, exts); err == nil {
return f, nil
} else {
return "", &Error{file, err}
}
return "", &Error{file, ErrNotFound}
}
if f, err := findExecutable(filepath.Join(".", file), exts); err == nil {
return f, nil

File diff suppressed because it is too large Load Diff

View File

@@ -50,7 +50,6 @@ func (sar *stepActionRemote) prepareActionExecutor() common.Executor {
}
github := sar.getGithubContext(ctx)
sar.remoteAction.URL = github.ServerURL
if sar.remoteAction.IsCheckout() && isLocalCheckout(github, sar.Step) && !sar.RunContext.Config.NoSkipCheckout {
common.Logger(ctx).Debugf("Skipping local actions/checkout because workdir was already copied")
@@ -111,7 +110,7 @@ func (sar *stepActionRemote) prepareActionExecutor() common.Executor {
URL: sar.remoteAction.CloneURL(),
Ref: sar.remoteAction.Ref,
Dir: actionDir,
Token: github.Token,
Token: "",
OfflineMode: sar.RunContext.Config.ActionOfflineMode,
})
var ntErr common.Executor
@@ -270,6 +269,26 @@ func (ra *remoteAction) IsCheckout() bool {
}
func newRemoteAction(action string) *remoteAction {
// support http(s)://host/owner/repo@v3
for _, schema := range []string{"https://", "http://"} {
if strings.HasPrefix(action, schema) {
splits := strings.SplitN(strings.TrimPrefix(action, schema), "/", 2)
if len(splits) != 2 {
return nil
}
ret := parseAction(splits[1])
if ret == nil {
return nil
}
ret.URL = schema + splits[0]
return ret
}
}
return parseAction(action)
}
func parseAction(action string) *remoteAction {
// GitHub's document[^] describes:
// > We strongly recommend that you include the version of
// > the action you are using by specifying a Git ref, SHA, or Docker tag number.
@@ -285,7 +304,7 @@ func newRemoteAction(action string) *remoteAction {
Repo: matches[2],
Path: matches[4],
Ref: matches[6],
URL: "https://github.com",
URL: "",
}
}