Hacker News new | ask | show | jobs
by newman314 1363 days ago
I generally like Actions but occasionally run into limitations (possibly my own).

For example, I'd like to build an action that triggers a documentation update based on the path and filename that is changed.

  on:
    push:
      branches: 
        - main
      paths:
        - */README.md
But there does not appear to be a way to pass a list of changed paths to the job.
3 comments

Maybe keep your documentation in a single directory?

  on:
    push:
      branches:
        - main
      paths:
        - docs/**
        - README.md
I use something similar for triggering different app workflows in a monorepo.

*EDIT* Or in multiple directories but grouped into multiple documentation directories.

  on:
    push:
      branches:
        - main
      paths:
        - package1/docs/**
        - package2/docs/**
        - package3/docs/**
        - README.md
GitHub Actions doesn't do anything to make this easy for you, but it's entirely possible to fall back on normal git operations to determine the files changed between two commits, e.g., https://stackoverflow.com/questions/1552340/how-to-list-only...