-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make command to re-run tests for translation PRs
- Loading branch information
1 parent
a4178ed
commit 366f54c
Showing
2 changed files
with
38 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if ! test -d .git; then | ||
echo "Error: This script must be run from the root of the openedx-translations repo" | ||
exit 1 | ||
fi | ||
|
||
if ! which gh; then | ||
echo "Error: This script requires the 'gh' command line tool." | ||
echo " See https://cli.github.com/ for installation instructions." | ||
exit 1 | ||
fi | ||
|
||
list_transifex_pull_requests() { | ||
gh pr list -L"${MAX_PULL_REQUESTS_TO_RESTART:-1000}" \ | ||
--search "is:open Updates for file translations/ Transifex Event" \ | ||
--json=number --jq='.[].number' | ||
} | ||
|
||
|
||
re_run_pull_request_tests() { | ||
echo "========================================" | ||
echo "Re-running tests for https://github.com/openedx/openedx-translations/pull/$1"; | ||
gh pr close $1; | ||
gh pr reopen $1; | ||
gh pr merge --auto --rebase $1; | ||
} | ||
|
||
|
||
for pull_request_number in $(list_transifex_pull_requests); do | ||
re_run_pull_request_tests $pull_request_number; | ||
done |