I am trying to get last check-in files.
Requirement is user will check-in a configuration file and that config file will be passed to a script for execution. If there are 4 files checked-in then, I need to identify all 4 file and execute script in loop for each file.
I was able to do it using following steps:
- name: checkout repo content
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Identify and execute different Configuration files
run: |
echo "Check-in configuration files are"
files=$(git diff --name-only HEAD^..HEAD)
However this is causing one issue.
If user perform git add, git commit, git add, git commit and then git push It only pick file of last commit only.
I want file to be picked from last PUSH to recent PUSH.
Please suggest