/laughing-telegram

Primary LanguagePythonMIT LicenseMIT

Python scripts in GitHub Actions

Learn how to run Python scripts on GitHub Actions! This allows you to handle logic that might be a bit more complex, like setting conditional behavior based on results.

Although GitHub actions is powerful as-is, it can get complicated when consuming inputs from other sources like an HTTP request providing JSON output.

Imagine a scenario where, depending on the JSON output of an HTTP request you have to do an API call. You might be able to do this with a specialized action or workflow, but with Python it might be easier.

The full video is available on YouTube, and the full lesson is also available on the O'Reilly platform

O'Reilly

🎥 Click the image above to access the full lesson on O'Reilly

Table of Contents

Lesson Content

The easiest way of going through the full lesson is using the O'Reilly platform but you can start here as well and on YouTube.

  1. Create a GitHub Action YAML file
  2. Add a Python file
  3. Create a repository secret
  4. Manually trigger your workflow

Learning Objectives

In this lesson you will learn:

  • How to run a Python script with GitHub Actions
  • Create a Python script that can be executed from an Action
  • Consume Action Secrets in the Python script
  • Explore other ways to install dependencies if needed

Useful Resources