Skip to content

A template for building GitHub Actions in Python | 一个用于开发 GitHub Actions 的 Python 容器模板

License

Notifications You must be signed in to change notification settings

actionv/python-container-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

基于 Python 容器的 GitHub Actions 模板

actions status release license PRs Welcome

这是一个用于快速创建 GitHub Actions 的模板,里面包含一段 Python 小程序,该应用程序内置到了 Container Action 中。

main.py 文件中有一个小示例,展示了如何获取 Action 输入参数并返回 Action 输出。

如果你想基于 Python 容器开发 GitHub Actions,可以在当前仓库上点击 Use this template,基于当前模板创建一个新的存储库。

使用

在此处描述如何使用你的 Action。

Workflow 示例

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 一个输出参数

实例

输入

with:
  username: yanglbme
  age: 99

输出

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