Skip to content

Commit

Permalink
ci(gh-actions): Set the PR description to be the same as the commit msg
Browse files Browse the repository at this point in the history
  • Loading branch information
PetarKirov committed May 6, 2024
1 parent 6bfda80 commit ff211bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
token: ${{ steps.generate-token.outputs.token }}
title: 'Update Nix Flake lockfile'
commit-message: ${{ env.COMMIT_MSG }}
body-path: ./commit_msg_body.txt
branch: 'create-pull-request/update-flake-lockfile'
delete-branch: true
branch-suffix: timestamp
Expand Down
13 changes: 12 additions & 1 deletion scripts/commit_flake_update.bash
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,19 @@ if [[ "$commit_after_update" = "$current_commit" ]]; then
exit 0
fi

msg_file=./commit_msg_body.txt
{
echo '```'
git log -1 '--pretty=format:%b' | sed '1,2d'
echo '```'
} > $msg_file

git commit --amend -F - <<EOF
chore(flake.lock): Update all Flake inputs ($(date -I))
$(git log -1 '--pretty=format:%b' | sed '1,2d')
$(cat $msg_file)
EOF

if [ -z "${CI+x}" ]; then
rm -v $msg_file
fi

0 comments on commit ff211bc

Please sign in to comment.