From 474eb920e4f5857083da9bc07c7935c0947a7b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Moreno=20Pe=C3=B1a?= Date: Mon, 26 Aug 2024 20:08:49 +0200 Subject: [PATCH] Update update-submodules.yml --- .github/workflows/update-submodules.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index ff76a5b..7dfe767 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -19,7 +19,7 @@ jobs: git submodule update --init --recursive git submodule update --recursive --remote - - name: Commit & push changes + - name: Commit, push changes & open PR run: | DATE=$(date '+%Y%m%d-%H%M') BRANCH_NAME="update-submodules/update-$DATE" @@ -34,14 +34,25 @@ jobs: git commit -am "Update submodules" git push origin $BRANCH_NAME - - name: create pull request - run: | + LATEST_TAG=$(git --git-dir=themes/adritian-free-hugo-theme/.git describe --tags --always) + + + echo "Creating pull-request..." + PR_TITLE='preview: update theme to `'$LATEST_TAG'`' + echo 'PR title: '$PR_TITLE + PR_BODY="🤖 This automated PR updates the theme submodule to a PR in the source repo: $PR_URL. + 🔗 Triggered by a [github action](https://github.com/zetxek/adrianmoreno.info/actions/workflows/update-submodules.yml)" + + echo "PR body: "$PR_BODY + + PR_TITLE='update theme to `'$SOURCE_BRANCH_NAME'`' DATE=$(date '+%Y%m%d-%H%M') BRANCH_NAME="update-submodules/update-$DATE" + gh pr create \ -B main \ -H $BRANCH_NAME \ - --title "Update site submodules" \ - --body "Created by Github action" + --title "$PR_TITLE" \ + --body --body "$PR_BODY" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}