-
-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: checkout branch before moving artifacts
- Loading branch information
1 parent
d940344
commit a706505
Showing
1 changed file
with
14 additions
and
11 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 |
---|---|---|
|
@@ -227,6 +227,19 @@ | |
|
||
# Token for accessing the repository: | ||
token: ${{ secrets.REPO_GITHUB_TOKEN }} | ||
|
||
# Checkout coverage repository branch: | ||
- name: 'Checkout coverage repository branch' | ||
run: | | ||
cd ./www-test-code-coverage | ||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
BRANCH_NAME="pr-${{ github.event.pull_request.number }}" | ||
git fetch origin $BRANCH_NAME || true | ||
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME | ||
else | ||
BRANCH_NAME="main" | ||
fi | ||
# Copy artifacts to the repository: | ||
- name: 'Copy artifacts to the repository' | ||
|
@@ -239,19 +252,9 @@ | |
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} | ||
USER_NAME: stdlib-bot | ||
run: | | ||
cd ./www-test-code-coverage | ||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
BRANCH_NAME="pr-${{ github.event.pull_request.number }}" | ||
git fetch origin $BRANCH_NAME || true | ||
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME | ||
else | ||
BRANCH_NAME="main" | ||
fi | ||
git add . | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "stdlib-bot" | ||
git add . | ||
git commit -m "Update artifacts" | ||
git push "https://$USER_NAME:[email protected]/stdlib-js/www-test-code-coverage.git" $BRANCH_NAME | ||