Skip to content

Commit defbeb8

Browse files
committed
Update dist/
1 parent 872e79e commit defbeb8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

dist/index.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ module.exports = JSON.parse("{\"name\":\"@octokit/rest\",\"version\":\"16.43.2\"
1616
"use strict";
1717

1818

19-
function fetchBranchConfig(branchName) {
19+
function fetchBranchConfig(branchName, core) {
2020
const fs = __webpack_require__(5747);
2121
const yaml = __webpack_require__(1917);
2222

23-
let fileContents = fs.readFileSync('./appspec.yml', 'utf8');
23+
try {
24+
let fileContents = fs.readFileSync('./appspec.yml', 'utf8');
25+
} catch (e) {
26+
if (e.code == 'ENOENT') {
27+
core.setFailed('🙄 appspec.yml file not found. Hint: Did you run actions/checkout?');
28+
process.exit();
29+
} else {
30+
throw e;
31+
}
32+
}
2433
let data = yaml.safeLoad(fileContents);
2534

2635
for (var prop in data.branch_config) {
@@ -40,7 +49,7 @@ function fetchBranchConfig(branchName) {
4049
}
4150

4251
exports.createDeployment = async function(applicationName, fullRepositoryName, branchName, commitId, runNumber, skipSequenceCheck, core) {
43-
const branchConfig = fetchBranchConfig(branchName);
52+
const branchConfig = fetchBranchConfig(branchName, core);
4453
const safeBranchName = branchName.replace(/[^a-z0-9-/]+/gi, '-').replace(/\/+/, '--');
4554
const deploymentGroupName = branchConfig.deploymentGroupName ? branchConfig.deploymentGroupName.replace('$BRANCH', safeBranchName) : safeBranchName;
4655
const deploymentGroupConfig = branchConfig.deploymentGroupConfig;

0 commit comments

Comments
 (0)