forked from TimonVS/pr-labeler-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
27 lines (22 loc) · 761 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const distPath = './dist/index.js';
const errorMessage = `ERROR: since pr-labeler-action v3, binding to the master version is no longer supported. Please update .github/workflows/pr-labeler.yml to bind to a major version.
You can do so by changing:
- uses: TimonVS/pr-labeler-action@master
To:
- uses: TimonVS/pr-labeler-action@v3
Please check the repository (https://github.com/TimonVS/pr-labeler-action) for the latest version.
`;
try {
require(distPath);
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {
// Re-throw not "Module not found" errors
throw error;
}
if (error.message.indexOf(distPath) === -1) {
// Re-throw not found errors for other modules
throw error;
}
console.error(errorMessage);
throw error;
}