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
|
||||
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
1
.gitignore
vendored
@@ -32,3 +32,4 @@ unit-tests.xml
|
||||
|
||||
# megalinter
|
||||
report/
|
||||
go1.24.0.linux-amd64.tar.gz
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
pull_request_rules:
|
||||
- name: warn on conflicts
|
||||
conditions:
|
||||
|
||||
8
Makefile
8
Makefile
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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: "",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user