diff --git a/.github/workflows/registry-updates.yaml b/.github/workflows/registry-updates.yaml index 5a9ccbc2..7c6a0326 100644 --- a/.github/workflows/registry-updates.yaml +++ b/.github/workflows/registry-updates.yaml @@ -16,8 +16,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Check if it's the first commit on branch + id: check_first_commit + run: | + if [ "${{ github.event.before }}" == "0000000000000000000000000000000000000000" ]; then + echo "::set-output name=first_commit::true" + else + echo "::set-output name=first_commit::false" + fi + - name: List changed files id: list_files run: | - git diff --name-only ${{ github.event.before }} ${{ github.event.after }} > changed_files.txt - + if [ "${{ steps.check_first_commit.outputs.first_commit }}" == "true" ]; then + git ls-tree --name-only -r ${{ github.sha }} > changed_files.txt + else + git diff --name-only ${{ github.event.before }} ${{ github.sha }} > changed_files.txt + fi