Skip to content

Commit 6c0e0e3

Browse files
authored
Merge pull request #461 from levibostian/master
2 parents 00b8bc0 + 77618ff commit 6c0e0e3

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ the Pull Request originated.
9797
| [Codefresh](https://codefresh.io/docs/docs/codefresh-yaml/variables#system-provided-variables) | `codefresh` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
9898
| [Codeship](https://documentation.codeship.com/basic/builds-and-configuration/set-environment-variables/#default-environment-variables) | `codeship` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: |
9999
| [Drone](https://readme.drone.io/reference/environ/) | `drone` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
100-
| [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables) | `github` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
100+
| [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables) | `github` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
101101
| [GitLab CI/CD](https://docs.gitlab.com/ce/ci/variables/README.html) | `gitlab` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
102102
| [Jenkins](https://wiki.jenkins.io/display/JENKINS/Building+a+software+project) | `jenkins` | :white_check_mark: | [:warning:](#jenkins) | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: | [:warning:](#jenkins) | [:warning:](#jenkins) | [:warning:](#jenkins) | :white_check_mark: | :white_check_mark: |
103103
| [Netlify](https://docs.netlify.com/configure-builds/environment-variables/#netlify-configuration-variables) | `netlify` | :white_check_mark: | [:warning:](#netlify) | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |

services/github.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export default {
5151
service: "github",
5252
commit: env.GITHUB_SHA,
5353
build: env.GITHUB_RUN_ID,
54+
buildUrl: `${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}`,
5455
isPr,
5556
branch,
5657
prBranch: isPr ? branch : undefined,

test/services/github.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const env = {
1313
GITHUB_REPOSITORY: "owner/repo",
1414
GITHUB_WORKSPACE: "/workspace",
1515
GITHUB_RUN_ID: "1246789",
16+
GITHUB_SERVER_URL: "https://github.com",
1617
};
1718

1819
test("Push", (t) => {
@@ -21,6 +22,7 @@ test("Push", (t) => {
2122
service: "github",
2223
commit: "1234",
2324
build: "1246789",
25+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
2426
branch: "master",
2527
isPr: false,
2628
prBranch: undefined,
@@ -35,6 +37,7 @@ test("Push - with short branch name", (t) => {
3537
service: "github",
3638
commit: "1234",
3739
build: "1246789",
40+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
3841
branch: "master",
3942
isPr: false,
4043
prBranch: undefined,
@@ -64,6 +67,7 @@ test("PR - with event.json file", (t) => {
6467
service: "github",
6568
commit: "1234",
6669
build: "1246789",
70+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
6771
branch: "master",
6872
isPr: true,
6973
prBranch: "refs/pull/10/merge",
@@ -95,6 +99,7 @@ test("PR - target", (t) => {
9599
service: "github",
96100
commit: "1234",
97101
build: "1246789",
102+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
98103
branch: "master",
99104
isPr: true,
100105
prBranch: "refs/pull/10/merge",
@@ -124,6 +129,7 @@ test("PR - with event.json file and short branch name", (t) => {
124129
service: "github",
125130
commit: "1234",
126131
build: "1246789",
132+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
127133
branch: "master",
128134
isPr: true,
129135
prBranch: "refs/pull/10/merge",
@@ -149,6 +155,7 @@ test("PR - with missing event.json file", (t) => {
149155
service: "github",
150156
commit: "1234",
151157
build: "1246789",
158+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
152159
branch: undefined,
153160
isPr: true,
154161
prBranch: "refs/pull/10/merge",
@@ -173,6 +180,7 @@ test("PR - with missing event.json file path", (t) => {
173180
service: "github",
174181
commit: "1234",
175182
build: "1246789",
183+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
176184
branch: undefined,
177185
isPr: true,
178186
prBranch: "refs/pull/10/merge",
@@ -202,6 +210,7 @@ test('PR - with missing "pull_request" in event.json file', (t) => {
202210
service: "github",
203211
commit: "1234",
204212
build: "1246789",
213+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
205214
branch: undefined,
206215
isPr: true,
207216
prBranch: "refs/pull/10/merge",
@@ -231,6 +240,7 @@ test('PR - with missing "pull_request.base" in event.json file', (t) => {
231240
service: "github",
232241
commit: "1234",
233242
build: "1246789",
243+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
234244
branch: undefined,
235245
isPr: true,
236246
prBranch: "refs/pull/10/merge",
@@ -247,6 +257,7 @@ test("Push - with incorrect branch name", (t) => {
247257
service: "github",
248258
commit: "1234",
249259
build: "1246789",
260+
buildUrl: "https://github.com/owner/repo/actions/runs/1246789",
250261
branch: undefined,
251262
isPr: false,
252263
prBranch: undefined,

0 commit comments

Comments
 (0)