From 3cf4375c25caf20cbf5e2bd598f1f353e55d4350 Mon Sep 17 00:00:00 2001 From: okamsn Date: Thu, 7 Mar 2024 19:05:56 -0500 Subject: [PATCH] Try getting commit message from file. --- .github/workflows/automatic-pr-to-dash-copy.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automatic-pr-to-dash-copy.yml b/.github/workflows/automatic-pr-to-dash-copy.yml index 4b674018..ce76af90 100644 --- a/.github/workflows/automatic-pr-to-dash-copy.yml +++ b/.github/workflows/automatic-pr-to-dash-copy.yml @@ -4,6 +4,10 @@ on: branches: - main - master + pull_request: + branches: + - main + - master permissions: contents: write @@ -20,6 +24,13 @@ jobs: with: ref: loopy-dash-only path: loopy-dash + - name: Copy commit message + run: | + cd loopy + git log \ + --format='(GitHub Action) %s%n%nCommit: %H%nAuthor: %an <%ae>%nDate: %ai%n%n%B' \ + -n 1 --no-color --encoding=utf8 HEAD > ../commit-msg.txt + cd .. - name: Copy file to directory run: cp loopy/loopy-dash.el loopy-dash/loopy-dash.el - name: Commit new changes and push. @@ -28,7 +39,7 @@ jobs: git config --local user.name "github-actions[bot]" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git add --force loopy-dash.el - git commit --allow-empty -m "Automatic commit of changes from master branch." + git commit --allow-empty -F ../commit-msg.txt git push env: USERNAME: github-actions[bot]