Skip to content
terminal

GitHub Action

Python Script in Actions

1.0 Latest version

Python Script in Actions

terminal

Python Script in Actions

Create an action in Python

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Python Script in Actions

uses: Tyler887/python-action@1.0

Learn more about this action in Tyler887/python-action

Choose a version

python-action

Write GitHub Actions workflows using Python by running python scripts. The tool uses Microsoft Windows Server.

Only supports Python 3. Python 2 is deprecated.

Usage

To use the workflow, there must be a workflow.py in the branch where you are trying to publish your action to Marketplace at. I reccommemd that your action runs on Windows-latest to ensure you are always running the latest version of Windows Server.

Example

action.y(a)ml

name: Python Hello World

jobs:
  python3runner:
    runs-on: windows-latest
    steps:
      - uses: Tyler887/python-action@main
        with:
          path: .\ # Rest of the path to the folder
        env:
          OWNER: # Owner of the repository defined in REPO
          REPO: # Name of the repo (without "OWNER/")
          

workflow.py

print("Hello World")