mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Improve CI script to handle PR branch cloning
- Modify the cloning command to check if the build is for a PR - Extract the PR number from the CIRCLE_PULL_REQUEST URL - Fetch the branch associated with the PR using the GitHub API - Clone the repository using the PR branch - Fallback to default behavior for regular branch builds
This commit is contained in:
@@ -759,7 +759,13 @@ jobs:
|
||||
- run:
|
||||
name: Cloning "meteor" Repository's current branch
|
||||
command: |
|
||||
git clone --branch $CIRCLE_BRANCH https://github.com/meteor/meteor.git ${CHECKOUT_METEOR_DOCS}
|
||||
if [[ -n "$CIRCLE_PULL_REQUEST" ]]; then
|
||||
PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | sed 's|.*/pull/\([0-9]*\)|\1|')
|
||||
PR_BRANCH=$(curl -s https://api.github.com/repos/meteor/meteor/pulls/$PR_NUMBER | jq -r .head.ref)
|
||||
git clone --branch $PR_BRANCH https://github.com/meteor/meteor.git ${CHECKOUT_METEOR_DOCS}
|
||||
else
|
||||
git clone --branch $CIRCLE_BRANCH https://github.com/meteor/meteor.git ${CHECKOUT_METEOR_DOCS}
|
||||
fi
|
||||
# Run almost the same steps the meteor/docs repository runs, minus deploy.
|
||||
- run:
|
||||
name: Generating Meteor documentation for JSDoc testing
|
||||
|
||||
Reference in New Issue
Block a user