GitHub - Get - modified files from the current commit.
I was looking into a way to get the files changed between the latest and previous commit in GitHub so that the workflow can process only the modified files after the commit or merge.
The below workflow, gets the modified files using the latest commit and previous commit sha and invokes the modified scripts in the repository.
This workflow uses “git diff” cli, previous and latest commit sha from the “github” object to get the modified files. This can be amended to filter further either to include “created”, “deleted” files etc by passing the relevant values to the “–diff-filter” parameter. More details about the “git diff” can be found here.
Respository
This repository contains a script to deploy M365 sites and M365 list.
If any of the deployment scripts are modified, workflow will execute those scripts.