我正在尝试获取上次签到文件。
要求是用户将签入配置文件,并且该配置文件将传递给脚本以供执行。如果签入了 4 个文件,我需要识别所有 4 个文件并为每个文件循环执行脚本。
我能够使用以下步骤做到这一点:
- 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)
但是这引起了一个问题。
如果用户执行 git add, git commit, git add, git commit 然后 git push 它只选择最后一次提交的文件。
我想从上次推送到最近推送中选择文件。
请推荐