https://github.com/actionv/python-container-action
A template for building GitHub Actions in Python | 一个用于开发 GitHub Actions 的 Python 容器模板
https://github.com/actionv/python-container-action
actions docker-container github-actions python
Last synced: 4 months ago
JSON representation
A template for building GitHub Actions in Python | 一个用于开发 GitHub Actions 的 Python 容器模板
- Host: GitHub
- URL: https://github.com/actionv/python-container-action
- Owner: actionv
- License: mit
- Created: 2020-03-30T11:49:26.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-12-15T13:04:09.000Z (over 3 years ago)
- Last Synced: 2024-03-15T10:22:29.453Z (over 1 year ago)
- Topics: actions, docker-container, github-actions, python
- Language: Python
- Homepage: https://github.com/marketplace/actions/a-python-container-action-template
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
基于 Python 容器的 GitHub Actions 模板
[](https://github.com/actionv/python-container-action/actions) [](../../releases) [](./LICENSE) [](../../pulls)
这是一个用于快速创建 GitHub Actions 的模板,里面包含一段 Python 小程序,该应用程序内置到了 Container Action 中。
在 [`main.py`](main.py) 文件中有一个小示例,展示了如何获取 Action 输入参数并返回 Action 输出。
如果你想基于 Python 容器开发 GitHub Actions,可以在[当前仓库](https://github.com/actionv/python-container-action)上点击 [Use this template](https://github.com/actionv/python-container-action/generate),基于当前模板创建一个新的存储库。
## 使用
在此处描述如何使用你的 Action。
### Workflow 示例
```yml
name: My Workflow
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Run action# 放置你的 Action 仓库
- uses: username/myaction@main# Action 的输入参数
with:
username: yanglbme
```### 入参
| 参数 | 描述 | 是否必传 | 默认值 |
| -------- | ------ | -------- | ------ |
| username | 用户名 | 是 | - |
| age | 年龄 | 否 | 18 |### 出参
| 参数 | 描述 |
| ---- | ------------ |
| res | 一个输出参数 |## 实例
### 输入
```yml
with:
username: yanglbme
age: 99
```### 输出
```yml
steps:
- uses: actions/checkout@v2
- name: Run action
id: myaction# 放置你的 Action 仓库
uses: me/myaction@main# Action 的输入参数
with:
username: yanglbme# 演示如何使用 Action 的输出
- name: Check outputs
run: |
echo "Outputs - ${{ steps.myaction.outputs.res }}"
```## License
MIT