Skip to content
settings

GitHub Action

Ritchie CLI action (python)

v2.1 Latest version

Ritchie CLI action (python)

settings

Ritchie CLI action (python)

Execute Ritchie CLI formulas implemented in PYTHON

Installation

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

              

- name: Ritchie CLI action (python)

uses: GuillaumeFalourd/ritchie-action-python@v2.1

Learn more about this action in GuillaumeFalourd/ritchie-action-python

Choose a version

ritchie-action-python

This Github action works for Ritchie CLI formulas implemented in Python.

Action workflow (PUBLIC)

Action workflow (PRIVATE)

Use cases

Executing a formula from a PUBLIC repository

name: Action workflow

on:
 push:
 workflow_dispatch:

jobs:
  action_job:
    runs-on: ubuntu-latest
    name: Ritchie Action
    steps:
    - name: Run Ritchie Action Command with PUBLIC repository
      uses: GuillaumeFalourd/ritchie-action-python@v2.0
      with:
        rit-repo-url: https://github.com/ZupIT/ritchie-formulas-demo
        rit-formula-command: rit demo coffee-python --rit_name=Dennis --rit_coffee_type=espresso --rit_delivery=false

Where:

  • rit-repo-url is the Github formula public repository url where the formula is located.
  • rit-formula-command is the formula command (with input flags if needed) implemented in python.

Executing a formula from a PRIVATE repository

name: Action workflow

on:
 push:
 workflow_dispatch:

jobs:
  action_job:
    runs-on: ubuntu-latest
    name: Ritchie Action
    steps:
    - name: Run Ritchie Action Command with PRIVATE repository
      uses: GuillaumeFalourd/ritchie-action-python@v2.0
      env:
        CREDENTIAL_GITHUB_USERNAME: ${{ secrets.CREDENTIAL_GITHUB_USERNAME }}
        CREDENTIAL_GITHUB_TOKEN: ${{ secrets.CREDENTIAL_GITHUB_TOKEN }}
      with:
        rit-repo-url: https://github.com/GuillaumeFalourd/formulas-training
        rit-formula-command: rit python math sum numbers --number_one=1 --number_two=2

Where:

  • CREDENTIAL_GITHUB_USERNAME is the GITHUB USERNAME saved as a secret.
  • CREDENTIAL_GITHUB_TOKEN is the GITHUB PERSONAL ACCESS TOKEN with full repository access saved as a secret.
  • rit-repo-url is the Github formula private repository url where the formula is located.
  • rit-formula-command is the formula command (with input flags if needed) implemented in Shell.