Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert: avoid failing the automerge-transifex-app-prs.yml #2325

Merged
merged 3 commits into from
Nov 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions .github/workflows/automerge-transifex-app-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,32 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Auto-merge pull request
- 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 }}"
run: |
# Add the pull request to the merge queue with --rebase commit strategy
gh pr merge ${{ github.head_ref }} --rebase --auto
with:
retry_wait_seconds: 180
max_attempts: 5
timeout_minutes: 15
retry_on: error
command: |
# Attempt to merge the PR
gh pr merge ${{ github.head_ref }} --rebase --auto

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