-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #539 from spyrkob/issue_536
[#536] update_post action - use the commit message to create PR title
- Loading branch information
Showing
1 changed file
with
3 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,21 +33,18 @@ jobs: | |
readonly COMMIT_EMAIL="[email protected]" | ||
FIX_BRANCH_NAME='' | ||
PR_TITLE="" | ||
SOURCE_LINK="" | ||
if [ "${ORIGINAL_PR}" != '' ]; then | ||
echo "Checking out PR${ORIGINAL_PR}" | ||
gh pr checkout "${ORIGINAL_PR}" --repo "${REPO_ID}" | ||
FIX_BRANCH_NAME="fix_pr_${ORIGINAL_PR}" | ||
SOURCE_LINK="[PR${ORIGINAL_PR}]($(gh browse ${ORIGINAL_PR} --repo "${REPO_ID}" -n))" | ||
PR_TITLE="Update date of PR: $(gh pr view 1 --repo "${REPO_ID}" --json title --jq '.title')" | ||
else | ||
echo "Using branch main" | ||
FIX_BRANCH_NAME="fix_pr_main" | ||
SOURCE_LINK="[main]($(gh browse -b main -n --repo "${REPO_ID}"))" | ||
PR_TITLE="Update date of post: ${OLD_POST}" | ||
fi | ||
if [ ! -f "_posts/${OLD_POST}" ]; then | ||
|
@@ -72,9 +69,10 @@ jobs: | |
git config --global user.name "${COMMIT_USERNAME}" | ||
git config --global user.email "${COMMIT_EMAIL}" | ||
git commit -am "Update ${OLD_POST} blog date" | ||
readonly COMMIT_MESSAGE="Update ${OLD_POST} blog date" | ||
git commit -am "${COMMIT_MESSAGE}" | ||
git push --set-upstream origin "${FIX_BRANCH_NAME}" | ||
gh pr create --title "${PR_TITLE}"\ | ||
gh pr create --title "${COMMIT_MESSAGE}"\ | ||
--body "Date update for ${OLD_POST} from ${SOURCE_LINK}"\ | ||
--repo "${REPO_ID}" |