Skip to content

Commit

Permalink
changes how the commits are fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
ntluong95 committed Jun 16, 2024
1 parent ea69a60 commit ddd53f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/create_pr_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
# Get the date of the latest commit on the translation branch
latest_commit_date=$(git show -s --format=%ci ${TRANSLATION_BRANCH})
# commits=$(gh api repos/${{ github.repository }}/commits --paginate --jq ".[] | select(.commit.author.date > \"$latest_commit_date\") | .sha")
commits=$(git log origin/"${EN_BRANCH#refs/heads/}" --since="$latest_commit_date" --pretty=format:"%H")
commits=$(gh api repos/${{ github.repository }}/commits --paginate --jq ".[] | select(.commit.author.date > \"$latest_commit_date\") | .sha")
# commits=$(git log origin/"${EN_BRANCH#refs/heads/}" --since="$latest_commit_date" --pretty=format:"%H")
echo "Commits on the English branch that were made after the latest commit on the translation branch: $commits at $latest_commit_date"
# Check if there are new commits
Expand All @@ -68,8 +68,8 @@ jobs:
PR_EXISTS=$(gh pr list --head "${TRANSLATION_BRANCH}" --state open --json number --jq length)
if [ "$PR_EXISTS" -eq 0 ]; then
echo "Creating new PR for ${TRANSLATION_BRANCH}"
PR_URL=$(gh pr create --base main --head "$TRANSLATION_BRANCH" --title "Handbook ${VERSION_SUFFIX/_en/} $lang" --body "Automated pull request for $lang handbook version ${VERSION_SUFFIX/_en/}")
# PR_URL=$(gh pr create --base "${EN_BRANCH#refs/heads/}" --head "$TRANSLATION_BRANCH" --title "Handbook ${VERSION_SUFFIX/_en/} $lang" --body "Automated pull request for $lang handbook version ${VERSION_SUFFIX/_en/}")
# PR_URL=$(gh pr create --base main --head "$TRANSLATION_BRANCH" --title "Handbook ${VERSION_SUFFIX/_en/} $lang" --body "Automated pull request for $lang handbook version ${VERSION_SUFFIX/_en/}")
PR_URL=$(gh pr create --base "${EN_BRANCH#refs/heads/}" --head "$TRANSLATION_BRANCH" --title "Handbook ${VERSION_SUFFIX/_en/} $lang" --body "Automated pull request for $lang handbook version ${VERSION_SUFFIX/_en/}")
PR_NUMBER=$(echo "$PR_URL" | grep -oE '[0-9]+$')
else
# Get the PR number for the translation branch
Expand Down

0 comments on commit ddd53f4

Please sign in to comment.