Skip to content

Commit

Permalink
fix: more robust date detection in automerge-transifex-app-prs.yml
Browse files Browse the repository at this point in the history
use bash if-statement to check for null instead of throwing
JavaScript after attempting to parse a null date.
  • Loading branch information
OmarIthawi committed Nov 18, 2023
1 parent 356b9ea commit c635b8e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/automerge-transifex-app-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ jobs:
# Attempt to merge the PR
gh pr merge ${{ github.head_ref }} --rebase --auto
# The `fromdate | todate` are used merge to validate that `mergedAt` isn't null
# therefore verifying that the pull request was merged successfully.
gh pr view "$PR_NUMBER" --json mergedAt --jq '.mergedAt | fromdate | todate'
MERGE_DATE="$(gh pr view "$PR_NUMBER" --json mergedAt --jq '.mergedAt')"
if [ -n "$MERGE_DATE" ]; then
echo "Success: PR merged at '$MERGE_DATE'"
exit 0
else
echo "PR not merged yet, retrying via 'nick-fields/retry'..."
exit 1
fi

0 comments on commit c635b8e

Please sign in to comment.