-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ko3n1g/ci/fix-auto-format-forks' into 'main'
ci: Disable auto-format on forks See merge request ADLR/megatron-lm!2337
- Loading branch information
Showing
1 changed file
with
11 additions
and
10 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,20 +231,21 @@ test:formatting: | |
if [[ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]]; then | ||
exit 0 | ||
fi | ||
- set +e | ||
- git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | ||
- git fetch origin main:main | ||
- git checkout $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | ||
- bash tools/autoformat.sh | ||
- set -e | ||
- git config --global user.email "[email protected]" | ||
- git config --global user.name "Mcore Bot" | ||
- git remote set-url origin "https://gitlab-ci-token:${PAT}@${GITLAB_ENDPOINT}/$CI_PROJECT_NAMESPACE/megatron-lm.git" | ||
- git add -A . | ||
- > | ||
git commit -m "chore: Format files" || true | ||
- git push -u origin $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | ||
- | | ||
if [[ "$CI_MERGE_REQUEST_PROJECT_PATH" == "$CI_MERGE_REQUEST_SOURCE_PROJECT_PATH" ]]; then | ||
bash tools/autoformat.sh | ||
set -e | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Mcore Bot" | ||
git remote set-url origin "https://gitlab-ci-token:${PAT}@${GITLAB_ENDPOINT}/$CI_PROJECT_NAMESPACE/megatron-lm.git" | ||
git add -A . | ||
git commit -m "chore: Format files" || true | ||
git push -u origin $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME | ||
fi | ||
- env | ||
- BASE_REF="$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" CHECK_ONLY=true SKIP_DOCS=$([[ "$CI_MERGE_REQUEST_LABELS" == *"Skip docs"* ]] && echo "true" || echo "false") bash tools/autoformat.sh | ||
|
||
|