Skip to content

Commit

Permalink
fix: don't fail after merging Transifex GitHub App pull requests
Browse files Browse the repository at this point in the history
otherwise it'll complain a lot about mergedAt being null
  • Loading branch information
OmarIthawi committed Oct 16, 2023
1 parent de6c266 commit 117a813
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/automerge-transifex-app-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,25 @@ jobs:
with:
fetch-depth: 0
- name: merge pull request
uses: nick-fields/retry@v2
id: mergePR
env:
# secrets can't be used in job conditionals, so we set them to env here
TRANSIFEX_APP_ACTOR_NAME: "${{ secrets.TRANSIFEX_APP_ACTOR_NAME }}"
TRANSIFEX_APP_ACTOR_ID: "${{ secrets.TRANSIFEX_APP_ACTOR_ID }}"
# This token requires Write access to the openedx-translations repo
GITHUB_TOKEN: ${{ secrets.EDX_TRANSIFEX_BOT_GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
if: "${{ github.actor == env.TRANSIFEX_APP_ACTOR_NAME && github.actor_id == env.TRANSIFEX_APP_ACTOR_ID }}"
uses: nick-fields/retry@v2
with:
retry_wait_seconds: 60
max_attempts: 5
timeout_minutes: 15
retry_on: error
command: |
# Attempt to merge the PR
gh pr merge ${{ github.head_ref }} --rebase --auto
gh pr status --json mergedAt --jq '.["currentBranch"]["mergedAt"] | fromdate'
# 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'

0 comments on commit 117a813

Please sign in to comment.