charmbracelet / vhs-action

Keep your GIFs up to date with VHS + GitHub actions 📽️
MIT License
187 stars 7 forks source link

Support for multiple tape files? #50

Open ghost opened 1 year ago

ghost commented 1 year ago

Hey Charm!

First off, I'm a big fan.

I'm integrating VHS into a new open source CLI here at SailPoint: https://github.com/sailpoint-oss/sailpoint-cli/pull/23

I was looking at utilizing this Action in the pipeline for that project, but I am creating tape files for most all of the independent CLI commands, and I can't tell if this action supports inputing multiple tape files?

If not I suppose I can just emulate the action in a more standard GH Workflow

spenserblack commented 1 year ago

To make a suggestion, I think this would be good usage, and I've seen many other actions do the same:

- uses: charmbracelet/vhs-action@<commit-ish>
  with:
    path: |
      path.tape
      path/with/glob/*.tape

In other words, path could be a newline-separated list of glob patterns.

mfigurski80 commented 1 year ago

I'd absolutely love this feature. I'm currently using a workaround solution of basically installing VHS and its dependencies manually and then using a small bash script to iterate over images/*.tape files. For reference, if anybody else is looking at this thread, that GitHub workflow is public here: https://github.com/mfigurski80/NTPeek/blob/master/.github/workflows/vhs.yml

spenserblack commented 1 year ago

Also, if https://github.com/charmbracelet/vhs-action/issues/56 and https://github.com/charmbracelet/vhs/issues/211 then the usage could also potentially just be

- uses: charmbracelet/setup-vhs@main
- run: vhs **.tape
ademariag commented 2 months ago

FYI I am using this:

name: Generate gifs from VHS tapes
on:
  pull_request:
    paths:
      - docs/tapes/*.tape

jobs:
  generate-matrix:
    name: Generate job matrices
    runs-on: ubuntu-latest
    outputs:
      vhs-files: ${{ steps.vhs-files.outputs.matrix }}
    steps:
      - name: Generate matrix | VHS Files
        id: vhs-files
        uses: hellofresh/action-changed-files@v3
        with:
            pattern: (?P<path>docs/tapes/(?P<tape>.+)\.tape)

  vhs:
    needs: [ generate-matrix ]
    runs-on: ubuntu-latest
    strategy:
      matrix: ${{ fromJson(needs.generate-matrix.outputs.vhs-files) }}
    if: ${{ fromJson(needs.generate-matrix.outputs.vhs-files).include[0] }}
    steps:
      - uses: actions/checkout@v3
      - uses: charmbracelet/vhs-action@v2.1.0
        with:
          path: ${{ matrix.path }}