Skip to content

Commit

Permalink
check for first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sordina committed Apr 15, 2024
1 parent 402623f commit 4c6abfa
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/registry-updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4c6abfa

Please sign in to comment.