Skip to content

Commit f9dd761

Browse files
committed
Changed to using GH_PROJECT variables
1 parent eb9cdab commit f9dd761

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.gitlab-ci.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ default:
99
interruptible: true
1010

1111
variables:
12+
GH_PROJECT_PATH: "MatrixAI/${CI_PROJECT_NAME}"
13+
GH_PROJECT_URL: "https://${GITHUB_TOKEN}@github.com/${GH_PROJECT_PATH}.git"
1214
GIT_SUBMODULE_STRATEGY: recursive
1315
# Cache .npm
1416
NPM_CONFIG_CACHE: "${CI_PROJECT_DIR}/tmp/npm"
@@ -97,7 +99,7 @@ build:merge:
9799
allow_failure: true
98100
script:
99101
# Required for `gh pr create`
100-
- git remote add upstream "https://${GITHUB_TOKEN}@github.com/MatrixAI/TypeScript-Demo-Lib-Native.git"
102+
- git remote add upstream "$GH_PROJECT_URL"
101103
- >
102104
nix-shell -I nixpkgs=./pkgs.nix --packages gitAndTools.gh --run '
103105
gh pr create \
@@ -107,11 +109,11 @@ build:merge:
107109
--body "This is an automatic PR generated by the pipeline CI/CD. This will be automatically fast-forward merged if successful." \
108110
--assignee "@me" \
109111
--no-maintainer-edit \
110-
--repo MatrixAI/TypeScript-Demo-Lib-Native || true;
112+
--repo "$GH_PROJECT_PATH" || true;
111113
printf "Pipeline Attempt on ${CI_PIPELINE_ID} for ${CI_COMMIT_SHA}\n\n${CI_PIPELINE_URL}" \
112114
| gh pr comment staging \
113115
--body-file - \
114-
--repo MatrixAI/TypeScript-Demo-Lib-Native;
116+
--repo "$GH_PROJECT_PATH";
115117
'
116118
rules:
117119
# Runs on staging commits and ignores version commits
@@ -245,7 +247,7 @@ build:prerelease:
245247
--notes "" \
246248
--prerelease \
247249
--target staging \
248-
--repo MatrixAI/TypeScript-Demo-Lib-Native;
250+
--repo "$GH_PROJECT_PATH";
249251
'
250252
after_script:
251253
- rm -f ./.npmrc
@@ -420,7 +422,7 @@ integration:prerelease:
420422
- echo 'Publishing application prerelease'
421423
- >
422424
nix-shell -I nixpkgs=./pkgs.nix --packages gitAndTools.gh --run '
423-
if gh release view "$CI_COMMIT_TAG" --repo MatrixAI/TypeScript-Demo-Lib-Native >/dev/null; then \
425+
if gh release view "$CI_COMMIT_TAG" --repo "$GH_PROJECT_PATH" >/dev/null; then \
424426
gh release \
425427
upload "$CI_COMMIT_TAG" \
426428
builds/*.closure.gz \
@@ -429,7 +431,7 @@ integration:prerelease:
429431
builds/*-win-* \
430432
builds/*-macos-* \
431433
--clobber \
432-
--repo MatrixAI/TypeScript-Demo-Lib-Native; \
434+
--repo "$GH_PROJECT_PATH"; \
433435
else \
434436
gh release \
435437
create "$CI_COMMIT_TAG" \
@@ -442,7 +444,7 @@ integration:prerelease:
442444
--notes "" \
443445
--prerelease \
444446
--target staging \
445-
--repo MatrixAI/TypeScript-Demo-Lib-Native; \
447+
--repo "$GH_PROJECT_PATH"; \
446448
fi;
447449
'
448450
rules:
@@ -486,9 +488,9 @@ integration:merge:
486488
printf "Pipeline Succeeded on ${CI_PIPELINE_ID} for ${CI_COMMIT_SHA}\n\n${CI_PIPELINE_URL}" \
487489
| gh pr comment staging \
488490
--body-file - \
489-
--repo MatrixAI/TypeScript-Demo-Lib-Native;
491+
--repo "$GH_PROJECT_PATH";
490492
'
491-
- git remote add upstream "https://${GITHUB_TOKEN}@github.com/MatrixAI/TypeScript-Demo-Lib-Native.git"
493+
- git remote add upstream "$GH_PROJECT_URL"
492494
- git checkout origin/master
493495
# Merge up to the current commit (not the latest commit)
494496
- git merge --ff-only "$CI_COMMIT_SHA"
@@ -575,7 +577,7 @@ release:distribution:
575577
--title "Build-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
576578
--notes "" \
577579
--target master \
578-
--repo MatrixAI/TypeScript-Demo-Lib-Native;
580+
--repo "$GH_PROJECT_PATH";
579581
'
580582
after_script:
581583
- rm -f ./.npmrc

0 commit comments

Comments
 (0)