Skip to content

Commit aa420c4

Browse files
fix(ci): install and use local hologit when testing PR
1 parent 7f85f5f commit aa420c4

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

.github/workflows/pr-test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ jobs:
4141
- run: npm install
4242
working-directory: github-actions/projector
4343

44+
- name: Install local hologit
45+
run: npm install -g .
46+
4447
- name: 'Test projection action: github-action-projector'
4548
uses: ./github-actions/projector/
4649
with:
4750
holobranch: github-action-projector
4851

49-
5052
- name: 'Test projection action: docs-site'
5153
uses: ./github-actions/projector/
5254
with:
53-
holobranch: docs-site
55+
holobranch: docs-site

github-actions/projector/index.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@ try {
2727
}
2828

2929
async function run() {
30-
try {
31-
core.startGroup('Installing Jarvus Hologit');
32-
await exec('npm install -g hologit');
33-
} catch (err) {
34-
core.setFailed(`Failed to install Jarvus Hologit: ${err.message}`);
35-
return;
36-
} finally {
37-
core.endGroup();
30+
// check if git-holo is already installed
31+
const isInstalled = await exec('which', ['git-holo'], { ignoreReturnCode: true, silent: true }) === 0;
32+
33+
if (isInstalled) {
34+
core.info('Hologit is already installed, skipping npm install');
35+
} else {
36+
try {
37+
core.startGroup('Installing Jarvus Hologit');
38+
await exec('npm install -g hologit');
39+
} catch (err) {
40+
core.setFailed(`Failed to install Jarvus Hologit: ${err.message}`);
41+
return;
42+
} finally {
43+
core.endGroup();
44+
}
3845
}
3946

4047

0 commit comments

Comments
 (0)