Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

fix: Github Action handles endpoints ending in / #249

Merged
merged 24 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f1fe5fe
small fix
StuartRucker Jul 22, 2020
2504776
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 23, 2020
05a89d7
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 23, 2020
82edb37
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 23, 2020
dd4f407
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 23, 2020
0e233e0
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 24, 2020
f9b6c18
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 24, 2020
11eaaec
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 27, 2020
15b2ba3
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 27, 2020
0e2e372
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Jul 28, 2020
e77ac2c
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 4, 2020
894b48b
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 5, 2020
b94874c
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 6, 2020
0a06c9c
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 10, 2020
f7e5f34
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 10, 2020
00e89d4
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 11, 2020
e6230ec
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 11, 2020
1c100c7
Merge branch 'master' of https://github.com/GoogleCloudPlatform/flaky…
StuartRucker Aug 14, 2020
fe3f167
url resolution
StuartRucker Aug 14, 2020
ae5f2ed
log url too
StuartRucker Aug 14, 2020
761fdb1
print url attempt 2
StuartRucker Aug 14, 2020
4ee4d85
dont install url
StuartRucker Aug 14, 2020
826e22b
Merge branch 'master' into actionurl
bcoe Aug 14, 2020
e2a2c44
Merge branch 'master' into actionurl
bcoe Aug 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/action/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ module.exports = require("https");
const fetch = __webpack_require__(492);
const fs = __webpack_require__(747);
const core = __webpack_require__(931);

const {resolve} = __webpack_require__(835);
/**
* main
*/
Expand Down Expand Up @@ -217,7 +217,7 @@ async function main () {
token: core.getInput('repo-token')
};

metaData.environment.matrix = JSON.stringify(metaData.environment.matrix, Object.keys(metaData.environment.matrix).sort()); // consistency
metaData.environment.matrix = JSON.stringify(metaData.environment.matrix, Object.keys(metaData.environment.matrix).sort()); // consistancy

metaData.environment.ref = metaData.environment.ref.replace('refs/', '');
metaData.environment.ref = metaData.environment.ref.replace('heads/', '');
Expand All @@ -232,7 +232,7 @@ async function main () {
const data = fs.readFileSync(
core.getInput('file-path'), 'utf8');
const sendMe = { type: fileType, data: data, metadata: metaData };
const endpoint = core.getInput('endpoint') + '/api/build/gh/v1';
const endpoint = resolve(core.getInput('endpoint'), '/api/build/gh/v1');
console.log('Beginning Upload of data...');
const outcome = await fetch(endpoint, {
method: 'POST',
Expand All @@ -248,7 +248,7 @@ async function main () {
throw 'Upload Failed';
} else if (outcomeAsJSON.message) {
console.log('Build Uploaded Successfully!');
console.log('Visit ' + core.getInput('endpoint') + '/org/' + process.env.GITHUB_REPOSITORY + ' to see uploaded data');
console.log('Visit ' + resolve(resolve(core.getInput('endpoint'),'/org/'), process.env.GITHUB_REPOSITORY) + ' to see uploaded data');
} else {
core.warning('Encountered unknown error, possibly involving server issues');
throw 'Unkown Error';
Expand Down Expand Up @@ -2194,4 +2194,4 @@ module.exports = eval("require")("encoding");

/***/ })

/******/ });
/******/ });
6 changes: 3 additions & 3 deletions packages/action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const fetch = require('node-fetch');
const fs = require('fs');
const core = require('@actions/core');

const {resolve} = require('url');
/**
* main
*/
Expand Down Expand Up @@ -65,7 +65,7 @@ async function main () {
const data = fs.readFileSync(
core.getInput('file-path'), 'utf8');
const sendMe = { type: fileType, data: data, metadata: metaData };
const endpoint = core.getInput('endpoint') + '/api/build/gh/v1';
const endpoint = resolve(core.getInput('endpoint'), '/api/build/gh/v1');
console.log('Beginning Upload of data...');
const outcome = await fetch(endpoint, {
method: 'POST',
Expand All @@ -81,7 +81,7 @@ async function main () {
throw 'Upload Failed';
} else if (outcomeAsJSON.message) {
console.log('Build Uploaded Successfully!');
console.log('Visit ' + core.getInput('endpoint') + '/org/' + process.env.GITHUB_REPOSITORY + ' to see uploaded data');
console.log('Visit ' + resolve(resolve(core.getInput('endpoint'),'/org/'), process.env.GITHUB_REPOSITORY) + ' to see uploaded data');
} else {
core.warning('Encountered unknown error, possibly involving server issues');
throw 'Unkown Error';
Expand Down
21 changes: 21 additions & 0 deletions packages/action/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"@actions/core": "^1.2.4",
"@actions/github": "^3.0.0",
"node-fetch": "^2.6.0",
"tap-parser": "^10.0.1"
"tap-parser": "^10.0.1",
"url": "^0.11.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually no need for this dep, url is built into Node.js with the exact same method signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

},
"devDependencies": {
"eslint": "^7.2.0",
Expand Down