chore: update configuration files and improve linting for Windows
- 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:
5
.github/workflows/checks.yml
vendored
5
.github/workflows/checks.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
|||||||
- name: Test Summary
|
- name: Test Summary
|
||||||
uses: test-summary/action@v2
|
uses: test-summary/action@v2
|
||||||
with:
|
with:
|
||||||
paths: "unit-tests.xml"
|
paths: 'unit-tests.xml'
|
||||||
if: always()
|
if: always()
|
||||||
- name: Run act from cli
|
- 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
|
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
|
- name: Test Summary
|
||||||
uses: test-summary/action@v2
|
uses: test-summary/action@v2
|
||||||
with:
|
with:
|
||||||
paths: "unit-tests.xml"
|
paths: 'unit-tests.xml'
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
|
|
||||||
snapshot:
|
snapshot:
|
||||||
name: snapshot
|
name: snapshot
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -32,3 +32,4 @@ unit-tests.xml
|
|||||||
|
|
||||||
# megalinter
|
# megalinter
|
||||||
report/
|
report/
|
||||||
|
go1.24.0.linux-amd64.tar.gz
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
pull_request_rules:
|
pull_request_rules:
|
||||||
- name: warn on conflicts
|
- name: warn on conflicts
|
||||||
conditions:
|
conditions:
|
||||||
|
|||||||
8
Makefile
8
Makefile
@@ -53,11 +53,19 @@ lint-md:
|
|||||||
|
|
||||||
.PHONY: lint-rest
|
.PHONY: lint-rest
|
||||||
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 \
|
docker run --rm -it \
|
||||||
-v $(PWD):/tmp/lint \
|
-v $(PWD):/tmp/lint \
|
||||||
-e GITHUB_STATUS_REPORTER=false \
|
-e GITHUB_STATUS_REPORTER=false \
|
||||||
-e GITHUB_COMMENT_REPORTER=false \
|
-e GITHUB_COMMENT_REPORTER=false \
|
||||||
megalinter/megalinter-go:v5
|
megalinter/megalinter-go:v5
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: lint-go lint-rest
|
lint: lint-go lint-rest
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ coverage:
|
|||||||
target: 50%
|
target: 50%
|
||||||
informational: true
|
informational: true
|
||||||
ignore:
|
ignore:
|
||||||
# Files generated by Google Protobuf do not require coverage
|
# Files generated by Google Protobuf do not require coverage
|
||||||
- '**/*.pb.go'
|
- '**/*.pb.go'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"syscall"
|
"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}
|
return &syscall.SysProcAttr{CmdLine: cmdLine, CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,9 +77,8 @@ func LookPath2(file string, lenv Env) (string, error) {
|
|||||||
if strings.ContainsAny(file, `:\/`) {
|
if strings.ContainsAny(file, `:\/`) {
|
||||||
if f, err := findExecutable(file, exts); err == nil {
|
if f, err := findExecutable(file, exts); err == nil {
|
||||||
return f, nil
|
return f, nil
|
||||||
} else {
|
|
||||||
return "", &Error{file, err}
|
|
||||||
}
|
}
|
||||||
|
return "", &Error{file, ErrNotFound}
|
||||||
}
|
}
|
||||||
if f, err := findExecutable(filepath.Join(".", file), exts); err == nil {
|
if f, err := findExecutable(filepath.Join(".", file), exts); err == nil {
|
||||||
return f, nil
|
return f, nil
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -50,7 +50,6 @@ func (sar *stepActionRemote) prepareActionExecutor() common.Executor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
github := sar.getGithubContext(ctx)
|
github := sar.getGithubContext(ctx)
|
||||||
sar.remoteAction.URL = github.ServerURL
|
|
||||||
|
|
||||||
if sar.remoteAction.IsCheckout() && isLocalCheckout(github, sar.Step) && !sar.RunContext.Config.NoSkipCheckout {
|
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")
|
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(),
|
URL: sar.remoteAction.CloneURL(),
|
||||||
Ref: sar.remoteAction.Ref,
|
Ref: sar.remoteAction.Ref,
|
||||||
Dir: actionDir,
|
Dir: actionDir,
|
||||||
Token: github.Token,
|
Token: "",
|
||||||
OfflineMode: sar.RunContext.Config.ActionOfflineMode,
|
OfflineMode: sar.RunContext.Config.ActionOfflineMode,
|
||||||
})
|
})
|
||||||
var ntErr common.Executor
|
var ntErr common.Executor
|
||||||
@@ -270,6 +269,26 @@ func (ra *remoteAction) IsCheckout() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newRemoteAction(action string) *remoteAction {
|
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:
|
// GitHub's document[^] describes:
|
||||||
// > We strongly recommend that you include the version of
|
// > We strongly recommend that you include the version of
|
||||||
// > the action you are using by specifying a Git ref, SHA, or Docker tag number.
|
// > 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],
|
Repo: matches[2],
|
||||||
Path: matches[4],
|
Path: matches[4],
|
||||||
Ref: matches[6],
|
Ref: matches[6],
|
||||||
URL: "https://github.com",
|
URL: "",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user