Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
film

GitHub Action

VHS Action

v1.0.1

VHS Action

film

VHS Action

Run VHS to render terminal videos

Installation

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

              

- name: VHS Action

uses: charmbracelet/vhs-action@v1.0.1

Learn more about this action in charmbracelet/vhs-action

Choose a version

VHS Action

GitHub Action to run VHS.

Welcome to VHS!

Inputs

Name Description Default
path Path of the VHS .tape file "vhs.tape"
version Version of VHS to use "latest"
token GitHub token to use "${{ github.token }}"
install-fonts Whether to install fonts "true"

Example Action

The following is a workflow that uses VHS to generate new GIFs (from vhs.tape) and then auto commits the GIF file to the repository.

name: vhs
on:
  push:
    paths:
      - vhs.tape
jobs:
  vhs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: charmbracelet/vhs-action@main
        with:
          path: 'vhs.tape'
      - uses: stefanzweifel/git-auto-commit-action@v4
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          commit_message: Update generated VHS GIF
          branch: main
          commit_user_name: vhs-action 📼
          commit_user_email: actions@github.com
          commit_author: vhs-action 📼 <actions@github.com>
          file_pattern: '*.gif'

Upload GIF to Imgur and comment in PR.

name: comment gif
on:
  pull_request:
    paths:
      - vhs.tape
jobs:
  pr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: charmbracelet/vhs-action@main
        with:
          path: 'vhs.tape'
      - uses: devicons/public-upload-to-imgur@v2.2.2
        id: imgur_step
        with:
          path: ./vhs.gif
          client_id: ${{ secrets.IMGUR_CLIENT_ID }} # Make sure you have this secret set in your repo
      - uses: github-actions-up-and-running/pr-comment@v1.0.1
        env:
          IMG_URL: ${{ fromJSON(steps.imgur_step.outputs.imgur_urls)[0] }}
          MESSAGE: |
            ![VHS GIf]({0})
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          message: ${{ format(env.MESSAGE, env.IMG_URL) }}

Available Fonts

The action will provide the following fonts (and their nerd font variations) by default:

  • Bitstream Vera Sans Mono
  • DejaVu
  • Fira Code
  • Hack
  • IBM Plex Mono
  • Inconsolata
  • JetBrains Mono
  • Liberation
  • Roboto Mono
  • Source Code Pro
  • Ubuntu Mono

Feedback

We’d love to hear your thoughts on this project. Feel free to drop us a note!

License

MIT


Part of Charm.

The Charm logo

Charm热爱开源 • Charm loves open source