summaryrefslogtreecommitdiffstats
path: root/internal (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* refactor(register): refactor registration functions and improve logging (#288)Bo-Yi Wu2023-07-121-3/+2
| | | | | | | | | | | - Remove the else clause in the `registerInteractive` function, and unconditionally log "Runner registered successfully." - Change the return value in the `doRegister` function from `nil` to `ctx.Err()`. Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/288 Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* fix(register): refactor context usage in registration functions (#286)Bo-Yi Wu2023-07-121-9/+7
| | | | | | | | | | | - Add context parameter to `registerNoInteractive`, `registerInteractive`, and `doRegister` functions - Remove the creation of a new context in `doRegister`, now using the passed context instead Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/286 Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* config: default container workspace set to host path (#279)Michael Santos2023-07-101-1/+1
| | | | | | | | | | | | | | | The container workspace path is overwritten by the default host workspace path ($HOME/.cache/act). Workaround: ```yaml host: workdir_parent: workspace ``` Ref: https://gitea.com/gitea/act_runner/commit/34d15f21c2ea8a6dbc8c3b905f332ec98ea0b813 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/279 Co-authored-by: Michael Santos <michael.santos@gmail.com> Co-committed-by: Michael Santos <michael.santos@gmail.com>
* Run as cache server (#275)Zettat1232023-07-075-14/+105
| | | | | | | | | | This PR - adds the `cache-server` command so act_runner can run as a cache server. When running as a cache server, act_runner only processes the requests related to cache and does not run jobs. - adds the `external_server` configuration for cache. If specified, act_runner will use this URL as the ACTIONS_CACHE_URL instead of starting a cache server itself. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/275 Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
* Add support for finding docker daemon from common socket paths (#263)Zettat1232023-07-011-0/+19
| | | | | | | | | | | | Caused by #260 act_runner will fail to start if user does not set `docker_host` configuration and `DOCKER_HOST` env. This PR adds the support for finding docker daemon from common socket paths so act_runner could detect the docker socket from these paths. The `commonSocketPaths` is from [nektos/act](https://github.com/nektos/act/blob/e60018a6d9403b27bfd1a1ed6111a6e9de0032fd/cmd/root.go#L124-L131) Reviewed-on: https://gitea.com/gitea/act_runner/pulls/263 Co-authored-by: Zettat123 <zettat123@noreply.gitea.com> Co-committed-by: Zettat123 <zettat123@noreply.gitea.com>
* Revert supporting multiple default actions URLs and use github for exec by ↵Jason Song2023-06-302-17/+7
| | | | | | | | | | | | | | default (#262) ## :warning: BREAKING :warning: Follow https://github.com/go-gitea/gitea/pull/25581 and gitea/act#70 . - Revert "Parse multiple default actions URLs (#200)" - Revert "fix defaultActionsUrls config for exec (#233)" - Use `https://github.com` for exec by default. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/262
* Improve the usage of `docker_host` configuration (#260)Zettat1232023-06-304-29/+62
| | | | | | | | | | | | | | Follow #242, #244 Fixes #258 Users could use `docker_host` configuration to specify which docker daemon will be used by act_runner. - If `docker_host` is **empty**, act_runner will find an available docker host automatically. - If `docker_host` is **"-"**, act_runner will find an available docker host automatically, but the docker host won't be mounted to the job containers and service containers. - If `docker_host` is **not empty or "-"**, the specified docker host will be used. An error will be returned if it doesn't work. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/260 Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
* add token support for exec (#247)Tomasz Duda2023-06-201-0/+6
| | | | | | | | | | allow to pass token from secrets Reviewed-on: https://gitea.com/gitea/act_runner/pulls/247 Reviewed-by: Jason Song <i@wolfogre.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Tomasz Duda <tomaszduda23@gmail.com> Co-committed-by: Tomasz Duda <tomaszduda23@gmail.com>
* Add option to configure workspace on host (#238)Marius Zwicker2023-06-203-2/+18
| | | | | | | | | | | | | | | | Adds a new section to the configuration which is used to control options when running in host mode. The first option added is to allow configuration of the location workspaces get created in. Depends on ~~gitea/act#65~~ Will resolve #235 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/238 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Marius Zwicker <marius.zwicker@mlba-team.de> Co-committed-by: Marius Zwicker <marius.zwicker@mlba-team.de>
* add ACT_EXEC (#246)Tomasz Duda2023-06-201-0/+2
| | | | | | | | | | Add env variable to distinguish build run locally from remote one. Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/246 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Tomasz Duda <tomaszduda23@gmail.com> Co-committed-by: Tomasz Duda <tomaszduda23@gmail.com>
* add --gitea-instance (#245)Tomasz Duda2023-06-201-9/+11
| | | | | | | | | | add --gitea-instance to let user specify address of endpoint of exec Related to https://gitea.com/gitea/act/pulls/68. Both can be merged independently though. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/245 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Tomasz Duda <tomaszduda23@gmail.com> Co-committed-by: Tomasz Duda <tomaszduda23@gmail.com>
* Move `docker.host` to `container.docker_host` (#244)Jason Song2023-06-193-13/+6
| | | | | | | | | | | | | Follow #242. Move `docker.host` to `container.docker_host`. There are already some options for docker/container in `container`, so developers could get confused about where to add options. It's breaking, but I think it's OK since `docker.host` was added just two days ago. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/244 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
* feat: improve Docker configuration and detection handling (#242)appleboy2023-06-184-4/+25
| | | | | | | | | | | | | | | - Pass `cfg` to `envcheck.CheckIfDockerRunning` function - Add `Docker` struct to `config.go` for Docker configuration - Update `config.example.yaml` with `docker` configuration options - Modify `CheckIfDockerRunning` in `docker.go` to use Docker host from config if provided Signed-off-by: appleboy <appleboy.tw@gmail.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/242 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: wxiaoguang <wxiaoguang@noreply.gitea.com> Co-authored-by: appleboy <appleboy.tw@gmail.com> Co-committed-by: appleboy <appleboy.tw@gmail.com>
* Add `ValidVolumes` config (#226)Zettat1232023-06-164-5/+18
| | | | | | | | | | | | | | Follow https://gitea.com/gitea/act/pulls/60, https://gitea.com/gitea/act/pulls/64 This PR adds the `valid_volumes` configuration. `valid_volumes` is a sequence containing the volumes (including bind mounts) that can be mounted to the container. By default, `valid_volumes` is empty, which means that no volumes can be mounted. Users can specify multiple valid volumes and [glob](https://github.com/gobwas/glob) is supported. All volumes will be allowed when using `exec` to run workflows locally. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/226 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
* Accept empty file as config (#241)Jason Song2023-06-151-6/+4
| | | | | | | | | | | Close #240 `yaml.Decoder.Decode` will return EOF when the root node is nil , see https://github.com/go-yaml/yaml/blob/v3/yaml.go#L125 While `yaml.Unmarshal` will accept it, see https://github.com/go-yaml/yaml/blob/v3/yaml.go#L162 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/241 Reviewed-by: Zettat123 <zettat123@noreply.gitea.com>
* Support changing labels (#201)sillyguodong2023-06-159-21/+138
| | | | | | | | | | | | | | Implement proposal: https://github.com/go-gitea/gitea/issues/24540 Related: - Protocol: https://gitea.com/gitea/actions-proto-def/pulls/9 - Gitea side: https://github.com/go-gitea/gitea/pull/24806 Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/201 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com>
* Exit with Code 1 if registering a runner fails (#228)MarkusLoeffler012023-06-091-3/+2
| | | | | | | | | | | | | | | | | | ### It's a "simple dirty fix" and I don't have any experiences with Go, so if this doesn't match your coding compliance, please adjust the code as needed I'm using bash scripts to register a token `./act_runner/act_runner register --no-interactive --name runner$number --instance http://localhost:3000 --token $token` But when a token is invalid, the command still returns 0, which is not practical for automation. A simple non-zero return would be more convenient for power users and developers. Co-authored-by: Markus Löffler <markus.loeffler@netcare.de> Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/228 Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com> Co-authored-by: MarkusLoeffler01 <markusloeffler01@noreply.gitea.com> Co-committed-by: MarkusLoeffler01 <markusloeffler01@noreply.gitea.com>
* fix defaultActionsUrls config for exec (#233)a10121127962023-06-081-6/+6
| | | | | | | | | | follow #200 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/233 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: a1012112796 <1012112796@qq.com> Co-committed-by: a1012112796 <1012112796@qq.com>
* Parse multiple default actions URLs (#200)Zettat1232023-06-061-20/+30
| | | | | | | | | | | | Follow https://gitea.com/gitea/act/pulls/58 Resolve https://github.com/go-gitea/gitea/issues/24789 Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/200 Reviewed-by: Jason Song <i@wolfogre.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
* refactor: daemon, config, and logging for better clarity (#225)Bo-Yi Wu2023-06-052-30/+63
| | | | | | | | | | | | | | - Import "path", "runtime", "strconv", and "strings" packages in daemon.go - Move "Starting runner daemon" log message to a different location - Refactor log formatter initialization and add debug level caller information - Split Config struct into separate Log, Runner, Cache, and Container structs with comments in config.go Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/225 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-committed-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* fix `artifactServerPath` and `artifactServerAddr` config for exec (#221)a10121127962023-06-051-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix exec logic to make `actions/download-artifact` and `actions/upload-artifact` can be used. example result: ```YML name: test-artifact on: - push - pull_request jobs: test-artifact-1: name: test 1 runs-on: ubuntu-latest steps: - run: echo `date` | tee time.txt - name: cache build result uses: actions/upload-artifact@v3 with: name: build-artifact path: time.txt retention-days: 1 test-artifact-2: name: test 2 needs: test-artifact-1 runs-on: ubuntu-latest steps: - name: Retrieve saved build result uses: actions/download-artifact@v3 with: name: build-artifact path: . - run: ls -lh - run: cat time.txt ``` ![image](/attachments/5cad3b4a-930a-4d42-a1ae-45ac32e6bfc2) Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/221 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: a1012112796 <1012112796@qq.com> Co-committed-by: a1012112796 <1012112796@qq.com>
* Remove trailing slash from instance address (#197)harryzcy2023-05-221-1/+1
| | | | | | | | | | | Related #136 Co-authored-by: harryzcy <harry@harryzheng.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/197 Reviewed-by: Jason Song <i@wolfogre.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: harryzcy <harryzcy@noreply.gitea.io> Co-committed-by: harryzcy <harryzcy@noreply.gitea.io>
* Add exec command flag of `network` (#192)sillyguodong2023-05-181-1/+3
| | | | | | | | | | | | Related to #184 Add command flag of `network` for `exec`, the default value of `--network` is empty string. Valid values are: `host `, `bridge`, `<custom_network>` and empty string. Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/192 Reviewed-by: a1012112796 <1012112796@qq.com> Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com>
* Add configuration item of `container.network` (#184)sillyguodong2023-05-164-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close https://gitea.com/gitea/act_runner/issues/177 Related https://gitea.com/gitea/act/pulls/56 ### ⚠️ Breaking The `container.network_mode` is a deprecated configuration item. It may be removed after Gitea 1.20 released. Previously, if the value of `container.network_mode` is `bridge`, it means that `act_runner` will create a new network for job.But `bridge` is easily confused with the bridge network created by Docker by default. We recommand that using `container.network` to specify the network to which containers created by `act_runner` connect. ### 🆕 container.network The configuration file of `act_runner` add a new item of `contianer.network`. In `config.example.yaml`: ```yaml container: # Specifies the network to which the container will connect. # Could be host, bridge or the name of a custom network. # If it's empty, act_runner will create a network automatically. network: "" ``` As the comment in the example above says, the purpose of the `container.network` is specifying the network to which containers created by `act_runner` will connect. `container.network` accepts the following valid values: - `host`: All of containers (including job containers and service contianers) created by `act_runner` will be connected to the network named `host` which is created automatically by Docker. Containers will share the host’s network stack and all interfaces from the host will be available to these containers. - `bridge`: It is similar to `host`. All of containers created by `act_runner` will be connected to the network named `bridge` which is created automatically by Docker. All containers connected to the `bridge` (Perhaps there are containers that are not created by `act_runner`) are allowed to communicate with each other, while providing isolation from containers which are not connected to that `bridge` network. - `<custom_network>`: Please make sure that the `<custom_network>` network already exists firstly (`act_runner` does not detect whether the specified network exists currently. If not exists yet, will return error in the stage of `docker create`). All of containers created by `act_runner` will be connected to `<custom_network>`. After the job is executed, containers are removed and automatically disconnected from the `<custom_network>`. - empty: `act_runner` will create a new network for each job container and their service containers (if defined in workflow). So each job container and their service containers share a network environment, but are isolated from others container and the Docker host. Of course, these networks created by `act_runner` will be removed at last. ### Others - If you do not have special needs, we highly recommend that setting `container.network` to empty string (and do not use `container.network_mode` any more). Because the containers created by `act_runner` will connect to the networks that are created by itself. This point will provide better isolation. - If you set `contianer.network` to empty string or `<custom_network>`, we can be access to service containers by `<service-id>:<port>` in the steps of job. Because we added an alias to the service container when connecting to the network. Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/184 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com>
* Skip counting log length when parseLogRow return nil (#176)Jason Song2023-05-064-5/+251
| | | | | | | | | | | | | Fix: ![image](/attachments/93e29bc0-3599-4f7e-8b90-512562a5d711) Regression of #149, `LogLength` could be incorrect. It may be related to https://github.com/go-gitea/gitea/issues/24458 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/176 Reviewed-by: Zettat123 <zettat123@noreply.gitea.io> Reviewed-by: wxiaoguang <wxiaoguang@noreply.gitea.io>
* fix `--event` option logic for `exec` (#175)a10121127962023-05-061-7/+5
| | | | | | | | | | - fix `--event` option logic - by the way, apply a `TODO` logic Reviewed-on: https://gitea.com/gitea/act_runner/pulls/175 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: a1012112796 <1012112796@qq.com> Co-committed-by: a1012112796 <1012112796@qq.com>
* Upgrade act and use new artifactcache (#174)Jason Song2023-05-049-713/+9
| | | | | | | | - Upgrade act to v0.245.1 - Replace `gitea.com/gitea/act_runner/internal/app/artifactcache` with `github.com/nektos/act/pkg/artifactcache` Reviewed-on: https://gitea.com/gitea/act_runner/pulls/174 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
* Support `configuration variables` (#157)sillyguodong2023-04-281-0/+1
| | | | | | | | | | | related to: https://gitea.com/gitea/act_runner/issues/127 `act_runner` only needs to pass `vars` from `Gitea` to `act`. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/157 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com>
* Add parent directory for working directory (#154)Zettat1232023-04-283-6/+13
| | | | | | | | | | | | | | | Fixes #145 At present, the working directory of a work flow is a path like `/<owner>/<repo>`, so the directory may conflict with system directory like `/usr/bin`. We need to add a parent directory for the working directory. In this PR, the parent directory is `/workspace` by default and users could configure it by the `workdir_parent` option. This change doesn't affect the host mode because in host mode the working directory will always be in `$HOME/.cache/act/` directory. Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/154 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
* Workflow commands (#149)Søren L. Hansen2023-04-272-5/+231
| | | | | | | | | | | | | | Establishes a simple framework for supporting workflow commands. Fully implements `::add-mask::`, `::debug::`, and `::stop-commands::`. Addresses #148 Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/149 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Søren L. Hansen <sorenisanerd@gmail.com> Co-committed-by: Søren L. Hansen <sorenisanerd@gmail.com>
* allow building act_runner with cgo (#137)techknowlogick2023-04-243-2/+23
| | | | | | | | | | | for platforms not supported by moderc.org/sqlite Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/137 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-committed-by: techknowlogick <techknowlogick@gitea.io>
* Support upload `outputs` and use `needs` context (#133)Jason Song2023-04-204-25/+199
| | | | | | | | | | | | | | See [Example usage of the needs context](https://docs.github.com/en/actions/learn-github-actions/contexts#example-usage-of-the-needs-context). Related to: - [actions-proto-def #5](https://gitea.com/gitea/actions-proto-def/pulls/5) - [gitea #24230](https://github.com/go-gitea/gitea/pull/24230) Reviewed-on: https://gitea.com/gitea/act_runner/pulls/133 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Zettat123 <zettat123@noreply.gitea.io> Co-authored-by: Jason Song <i@wolfogre.com> Co-committed-by: Jason Song <i@wolfogre.com>
* Fix reporting log in `Reporter.Close` (#126)Zettat1232023-04-191-1/+1
| | | | | | | | | | | Previously, the `Close` func returns incorrectly so that the logs may not be reported. This PR fixes the incorrect return and sets the `StoppedAt` to get the correct task duration. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/126 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
* Set specific environments to distinguish between Gitea and GitHub (#113)Jason Song2023-04-121-0/+4
| | | | | | | | | | Close https://github.com/go-gitea/gitea/issues/24038 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/113 Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-committed-by: Jason Song <i@wolfogre.com>
* Run as a container (#8) including Docker-in-Docker. (#84)Thomas E Lackey2023-04-114-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | This adds a very simple Dockerfile and run script for running `act_runner` as a container. It also allows setting `Privileged` and `ContainerOptions` flags via the new config file when spawning task containers. The combination makes it possible to use Docker-in-Docker (which requires `privileged` mode) as well as pass any other options child Docker containers may require. For example, if Gitea is running in Docker on the same machine, for the `checkout` action to behave as expected from a task container launched by `act_runner`, it might be necessary to map the hostname via something like: ``` container: network_mode: bridge privileged: true options: --add-host=my.gitea.hostname:host-gateway ``` > NOTE: Description updated to reflect latest code. > NOTE: Description updated to reflect latest code (again). Reviewed-on: https://gitea.com/gitea/act_runner/pulls/84 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com> Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
* feat: add artifact api from gitea server (#103)fuxiaohei2023-04-101-0/+8
| | | | | | | | | | | add action api for artifacts upload and download. It's related to https://github.com/go-gitea/gitea/pull/22738 Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act_runner/pulls/103 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: fuxiaohei <fuxiaohei@vip.qq.com> Co-committed-by: fuxiaohei <fuxiaohei@vip.qq.com>
* Fix panic when response is nil (#105)Jason Song2023-04-061-1/+1
| | | | | | | Reviewed-on: https://gitea.com/gitea/act_runner/pulls/105 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-committed-by: Jason Song <i@wolfogre.com>
* Supports configuring fetch_timeout and fetch_interval. (#100)Jason Song2023-04-063-16/+27
| | | | | | | | | Fix #99. Fix #94. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/100 Reviewed-by: Zettat123 <zettat123@noreply.gitea.io>
* Refactor to new framework (#98)Jason Song2023-04-0425-0/+2799
- Adjust directory structure ```text ├── internal │   ├── app │   │   ├── artifactcache │   │   ├── cmd │   │   ├── poll │   │   └── run │   └── pkg │   ├── client │   ├── config │   ├── envcheck │   ├── labels │   ├── report │   └── ver └── main.go ``` - New pkg `labels` to parse label - New pkg `report` to report logs to Gitea - Remove pkg `engine`, use `envcheck` to check if docker running. - Rewrite `runtime` to `run` - Rewrite `poller` to `poll` - Simplify some code and remove what's useless. Reviewed-on: https://gitea.com/gitea/act_runner/pulls/98 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-committed-by: Jason Song <i@wolfogre.com>