diff --git a/apps/action-runner/2.328.0/data.yml b/apps/action-runner/2.328.0/data.yml new file mode 100644 index 000000000..fa70f5562 --- /dev/null +++ b/apps/action-runner/2.328.0/data.yml @@ -0,0 +1,77 @@ +additionalProperties: + formFields: + - default: "repos" + edit: true + envKey: ROLE + labelEn: Role (Repository or Organization) + labelZh: 角色 (个人仓库或者组织) + required: true + type: select + values: + - label: "个人仓库 Repository" + value: "repos" + - label: "企业 Enterprise" + value: "enterprises" + - label: "组织 Organization" + value: "orgs" + + - default: "owner/repo" + edit: true + envKey: REPO + labelEn: Repository name or organization name + labelZh: 仓库名或组织名 + required: true + type: text + + - default: "" + edit: true + envKey: GITHUB_TOKEN + labelEn: Github Token + labelZh: Github 令牌 + required: true + type: text + + - default: "" + edit: true + envKey: RUNNER_NAME + labelEn: Runner Name + labelZh: 运行器名称 + required: false + type: text + + - default: "label1,label2" + edit: true + envKey: RUNNER_LABELS + labelEn: Runner Labels + labelZh: 运行器标签 + required: false + type: text + + - default: "_work" + edit: true + envKey: WORK_FOLDER + labelEn: Work Folder + labelZh: 工作文件夹 + required: false + type: text + + - default: "Default" + edit: true + envKey: RUNNER_GROUP + labelEn: Runner Group + labelZh: 运行器组 + required: false + type: text + + - default: "false" + edit: true + envKey: AUTO_UNREGISTER + labelEn: Unregister the Runner when the container is stopped + labelZh: 是否在容器停止时注销 Runner + required: false + type: select + values: + - label: "True" + value: "true" + - label: "False" + value: "false" diff --git a/apps/action-runner/2.328.0/docker-compose.yml b/apps/action-runner/2.328.0/docker-compose.yml new file mode 100644 index 000000000..c3a8d8147 --- /dev/null +++ b/apps/action-runner/2.328.0/docker-compose.yml @@ -0,0 +1,26 @@ +services: + actions-runner: + image: ghcr.io/pooneyy/actions-runner:2.328.0 + container_name: ${CONTAINER_NAME} + restart: always + privileged: true + networks: + - 1panel-network + labels: + createdBy: "Apps" + environment: + ROLE: ${ROLE} + REPO: ${REPO} + RUNNER_GITHUB_TOKEN: ${GITHUB_TOKEN} + RUNNER_NAME: ${RUNNER_NAME} + RUNNER_LABELS: ${RUNNER_LABELS} + WORK_FOLDER: ${WORK_FOLDER} + RUNNER_GROUP: ${RUNNER_GROUP} + AUTO_UNREGISTER: ${AUTO_UNREGISTER} + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ./config:/home/runner/.runner_config + +networks: + 1panel-network: + external: true diff --git a/apps/action-runner/README.md b/apps/action-runner/README.md new file mode 100644 index 000000000..43dc94eb0 --- /dev/null +++ b/apps/action-runner/README.md @@ -0,0 +1,23 @@ +# Github Action Runner + +![](https://fastly.jsdelivr.net/gh/actions/runner@main/docs/res/github-graph.png) + +运行在容器中的简单的自托管 GitHub Actions 运行器 + +## 功能 + +- 支持 Docker-in-Docker + +### 环境变量 +| 参数 | 是否必须 | 说明 | +| --- | --- | --- | +| `ROLE` | 必须 | 用于区分企业、组织与个人仓库
企业为 `enterprises` 组织为 `orgs` ,个人仓库为 `repos`
**REST API** | +| `REPO` | 必须 | 企业格式为`enterpriseName`
组织格式为`orgName`
个人仓库格式为 `owner/repo`
**REST API** | +| `RUNNER_GITHUB_TOKEN` | 必须 | [推荐 Fine-grained PAT](https://github.com/settings/personal-access-tokens/new)。
对于企业:
**Fine-grained PAT 不能用于企业**
OAuth 应用令牌和PAT(classic)需要 `manage_runners:enterprise` 权限。
对于组织:
应具备 Self-hosted runners 的读写权限。
OAuth 令牌和PAT(classic)需要 `admin:org` 权限,
此外私有组织仓库还需要 `repo` 权限。
对于个人仓库:
应具备 Administration 的读写权限。
OAuth 令牌和PAT(classic)需要 `repo` 权限。
[如何创建令牌?](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
**REST API** | +| `RUNNER_NAME` | | Runner 名称,留空随机生成。
在同一个个人仓库(或企业、组织)中 Runner 名称不能重复。 | +| `RUNNER_LABELS` | | Runner 标签,填写此项会增加新的标签,
若填入多个标签则用半角逗号分隔。
示例: `label1,label2` | +| `WORK_FOLDER` | | 工作文件夹,留空随机生成,几乎用不上。 | +| `RUNNER_GROUP` | | Runner 组,默认值为`Default`,具体参见[文档](https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/manage-access)。 | +| `AUTO_UNREGISTER` | | 是否在容器停止时从 github.com 注销 Runner,默认为 `false`。 | + +关于标注了**REST API**的问题,参考[文档](https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28)。 diff --git a/apps/action-runner/README_en.md b/apps/action-runner/README_en.md new file mode 100644 index 000000000..7a38d4d66 --- /dev/null +++ b/apps/action-runner/README_en.md @@ -0,0 +1,23 @@ +# Simple Github Action Runner In Docker + +![](http://fastly.jsdelivr.net/gh/actions/runner@main/docs/res/github-graph.png) + +A simple self-hosted actions runner running in a container + +## Features + +- Supports Docker-in-Docker + +### Environment Variables +| Parameter | Required | Description | +| --- | --- | --- | +| `ROLE` | Required | Used to differentiate between enterprise, organization, and personal repositories.
Use `enterprises` for enterprise, `orgs` for organization, and `repos` for personal repositories.
**REST API** | +| `REPO` | Required | Format for enterprise: `enterpriseName`
Format for organization: `orgName`
Format for personal repository: `owner/repo`
**REST API** | +| `RUNNER_GITHUB_TOKEN` | Required | [Fine-grained PAT is recommended](https://github.com/settings/personal-access-tokens/new).
For enterprises:
**Fine-grained PAT cannot be used for enterprises**
OAuth app tokens and PAT (classic) require the `manage_runners:enterprise` permission.
For organizations:
Fine-grained PAT should have read and write permissions for Self-hosted runners.
OAuth tokens and PAT (classic) require `admin:org` permissions,
additionally, `repo` permissions are required for private organization repositories.
For personal repositories:
Fine-grained PAT should have read and write permissions for Administration.
OAuth tokens and PAT (classic) require `repo` permissions.
[How to create a token?](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
**REST API** | +| `RUNNER_NAME` | | Runner name. If left empty, it will be randomly generated.
Runner names must be unique within the same personal repository (or enterprise/organization). | +| `RUNNER_LABELS` | | Runner labels. Filling this will add new labels..
Use commas to separate multiple labels.
Example: `label1,label2` | +| `WORK_FOLDER` | | Working directory. If left empty, it will be randomly generated. Rarely needed. | +| `RUNNER_GROUP` | | Runner group. The default value is `Default`. For details, refer to the [documentation](https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/manage-access). | +| `AUTO_UNREGISTER` | | Whether to unregister the Runner from github.com when the container stops.
Default is `false`. It is recommended to map /home/runner/.runner_config
to a local when selecting false. This folder saves Runner's login status. | + +For parameters marked with **REST API**, refer to the [documentation](https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28). diff --git a/apps/action-runner/data.yml b/apps/action-runner/data.yml new file mode 100644 index 000000000..689d4a7aa --- /dev/null +++ b/apps/action-runner/data.yml @@ -0,0 +1,19 @@ +name: Action Runner +tags: + - DevOps +title: Github 自托管运行器 +description: Github 自托管运行器 +additionalProperties: + key: action-runner + name: Action Runner + tags: + - DevOps + shortDescZh: Github 自托管运行器 + shortDescEn: The Self-hosted Runner for GitHub Actions + type: tool + crossVersionUpdate: true + limit: 0 + recommend: 0 + website: https://github.com/actions/runner + github: https://github.com/actions/runner + document: https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners diff --git a/apps/action-runner/logo.png b/apps/action-runner/logo.png new file mode 100644 index 000000000..e7917cb3b Binary files /dev/null and b/apps/action-runner/logo.png differ