Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Commit 6ed181b

Browse files
committed
Addressing PR feedback
1 parent 8405c1b commit 6ed181b

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

actions/add-review-url/lib/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ function run() {
2828
const addComment = new AddReviewUrl_1.default();
2929
try {
3030
const host = core.getInput('host');
31-
let headref = '';
32-
if (process.env.GITHUB_HEAD_REF) {
33-
headref = process.env.GITHUB_HEAD_REF.toString();
34-
}
31+
let headref = process.env.GITHUB_HEAD_REF || '';
3532
const comment = `You can see a private version of the changes made in this pull request here:\nhttp://${headref}.s.${host}/`;
3633
yield addComment.addComment(comment);
3734
}

actions/add-review-url/package-lock.json

Lines changed: 22 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/add-review-url/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "addcomment",
2+
"name": "addreviewurl",
33
"version": "1.0.0",
44
"description": "Add Review Url as a comment on the pull request",
55
"main": "lib/index.js",

actions/add-review-url/src/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ import AddComment from './AddReviewUrl';
44
import * as core from "@actions/core";
55

66
async function run() {
7-
const addComment = new AddComment();
7+
const addComment = new AddComment();
88
try {
99
const host = core.getInput('host');
10-
let headref = '';
11-
if (process.env.GITHUB_HEAD_REF)
12-
{
13-
headref = process.env.GITHUB_HEAD_REF.toString();
14-
}
10+
let headref = process.env.GITHUB_HEAD_REF || '';
1511
const comment = `You can see a private version of the changes made in this pull request here:\nhttp://${headref}.s.${host}/`;
1612
await addComment.addComment(comment);
1713
}catch (error) {

0 commit comments

Comments
 (0)