Skip to content

Commit

Permalink
ci(distrolist.yml): create only one branch per change
Browse files Browse the repository at this point in the history
  • Loading branch information
ook37 committed Oct 20, 2024
1 parent daf33fd commit 4507a0d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/distrolist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ jobs:
fi
echo "distlist_title=${title}" >> $GITHUB_ENV
echo "distlist_body=Automatically generated by CI" >> $GITHUB_ENV
echo "dl_date=$(date +'%Y-%m-%d/%H_%M_%S')" >> $GITHUB_ENV
echo "dl_hash=$(echo -n "${title}" | sha256sum | cut -c1-8)" >> $GITHUB_ENV
if git ls-remote --heads origin | grep "update-distrolist-${dl_hash}"; then
echo "No changes to distrolist."
echo "changes_detected=false" >> $GITHUB_ENV
exit 0
fi
- name: Create PR if changes detected
if: env.changes_detected == 'true'
Expand All @@ -91,6 +96,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: distrolist
base: master
branch: update-distrolist-${{ env.dl_date }}
branch: update-distrolist-${{ env.dl_hash }}
title: ${{ env.distlist_title }}
body: ${{ env.distlist_body }}

0 comments on commit 4507a0d

Please sign in to comment.