- Remove Trivy vulnerability scanning and upload of scan results to GitHub Security tab from the workflow
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add gpg to the list of installed packages for testing
- Specify Codecov upload flags based on Go version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Enable testing across Go 1.24 and 1.25 using a matrix strategy
- Update the container image to dynamically use the selected Go version
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add golines to the list of golangci-lint formatters
- Format multi-line env variable declarations for CLI flags for consistency
- Split string slice initializations onto multiple lines for improved readability in tests
- Use multi-line function calls for better readability in plugin and test code
- Improve readability of script command appends in logic and tests
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add explicit permissions for contents, packages, and security-events to the Docker GitHub Actions workflow
- Integrate Trivy vulnerability scanning and results upload into the Docker workflow
- Add a dedicated GitHub Actions workflow for Trivy security scanning of both repository files and Docker images, with scheduled, push, and pull request triggers
- Ensure Trivy SARIF results are uploaded to the GitHub Security tab after scans
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update Go version requirement from 1.23.0 to 1.24.0
- Upgrade golang.org/x/crypto dependency to v0.45.0
- Upgrade golang.org/x/sys dependency to v0.38.0
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Refactor SSH-related integration tests to use a reusable SSHTestConfig struct and a new runSSHContainerTest helper function
- Support testing both key-based and password-based authentication by passing configuration via SSHTestConfig
- Move duplicated test setup code for containerized SSH server to the helper function
- Update assertions to check outputs against configurable expected values for each test
- Add test for password-based authentication in addition to existing sudo command test
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Remove USER_PASSWORD from test environment setup
- Update comment to correctly state that password authentication is disabled
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Disable password authentication by setting PASSWORD_ACCESS to false in TestSudoCommand
- Remove the use of direct password authentication in favor of key-based authentication in TestSudoCommand
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a test that dynamically starts an OpenSSH server in a Docker container for integration testing.
- Configure the container with test credentials, allow password and sudo access, and inject the public key.
- Update the test to use the actual Docker container's hostname, dynamic port, username, and password.
- Improve error handling and test skipping if the Docker environment is not available.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Remove unused import of strconv
- Remove environment variables PUID and PGID from the test container setup
- Enable UseInsecureCipher in SSH options for compatibility
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update several dependencies to newer versions, including urfave/cli, x/crypto, ScaleFT/sshkeys, go-md2man, and x/sys
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a Table of Contents section to the English, Simplified Chinese, and Traditional Chinese README files
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Improve and clarify English wording and formatting throughout the documentation for better readability
- Update section titles and add missing punctuation for consistency
- Revise build instructions and descriptions for accuracy and clarity
- Enhance phrasing in Chinese (Simplified and Traditional) documentation for clarity and consistency
- Remove outdated explanatory comments and improve example references in all README files
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add links to Traditional and Simplified Chinese README files, and label English as the default language
- Fix formatting for the list of supported platforms in the main README
- Add a Simplified Chinese version of the README with equivalent content and instructions
- Add a Traditional Chinese version of the README with equivalent content and instructions
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* chore: enhance testing with updated libraries and new test cases
- Update `testify` library from `v1.8.4` to `v1.10.0`
- Add dependency for `testcontainers-go` library
- Add various indirect dependencies
- Include `context` and `fmt` packages in test file
- Add test for SSH connection using `testcontainers` library
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* refactor: improve performance by optimizing string conversions
- Add the `strconv` import.
- Replace `fmt.Sprintf` with `strconv.Itoa` for converting UID and GID to string.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* test: switch to alternative image source for SSH testing
- Update image name in the SSH test from `lscr.io/linuxserver/openssh-server:latest` to `linuxserver/openssh-server:latest`.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
---------
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update `.golangci.yaml` to version 2 and streamline settings
- Remove specific linters from `.golangci.yaml` configuration
- Add exclusion and formatter settings to `.golangci.yaml`
- Change error message formatting in `plugin.go` to lowercase
- Use `strings.ReplaceAll` instead of `strings.Replace` for better readability and performance in `plugin.go` and `plugin_test.go`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update Go version from 1.22 to 1.23
- Upgrade golang.org/x/crypto from version 0.29.0 to 0.36.0
- Upgrade golang.org/x/sys from version 0.27.0 to 0.31.0
- Change Docker image in GitHub Actions from golang:1.22-alpine to golang:1.23-alpine
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a new dependency on `github.com/yassinebenaid/godump`
- Include `godump` in the import statements
- Add a new environment variable `DEBUG` to the existing list
- Implement a debug dump of the plugin if debugging is enabled
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Simplify log output by removing "out:" and "err:" prefixes in `plugin.go`
- Update test expectations to match the new log output format
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update `github.com/urfave/cli/v2` to version `2.27.5`
- Update `golang.org/x/crypto` to version `0.29.0`
- Update `github.com/cpuguy83/go-md2man/v2` to version `2.0.5`
- Update `golang.org/x/sys` to version `0.27.0`
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a `.golangci.yaml` configuration file with various linters enabled and specific settings for `gosec` and `perfsprint`.
- Change `isTimeout` from being initialized to `true` to being declared as a `bool` variable without an initial value in `plugin.go`.
Signed-off-by: appleboy <appleboy.tw@gmail.com>
My OCD just kicks in :)) This has bothered me for a long time. Will also update README in https://github.com/appleboy/ssh-action to reflect this change.
- Alias `github.com/appleboy/easyssh-proxy` import as `easyssh` in `main.go`
- Alias `github.com/appleboy/easyssh-proxy` import as `easyssh` in `plugin.go`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `golang.org/x/crypto` dependency from `v0.24.0` to `v0.25.0`
- Update `golang.org/x/sys` dependency from `v0.21.0` to `v0.22.0`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Remove `make build_linux_arm` step
- Update `docker/setup-qemu-action` from v2 to v3
- Update `docker/setup-buildx-action` from v2 to v3
- Update `docker/login-action` from v2 to v3
- Update `docker/metadata-action` from v4 to v5
- Update `docker/build-push-action` from v4 to v6
- Remove `linux/arm` from the platforms list
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `golang.org/x/crypto` dependency from v0.23.0 to v0.24.0
- Update `golang.org/x/sys` dependency from v0.20.0 to v0.21.0
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Update `github.com/urfave/cli/v2` to version `2.27.2`
- Update `golang.org/x/crypto` to version `0.23.0`
- Update `github.com/xrash/smetrics` to version `0.0.0-20240521201337-686a1a2994c1`
- Update `golang.org/x/sys` to version `0.20.0`
Signed-off-by: appleboy <appleboy.tw@gmail.com>