Skip to content

Commit

Permalink
Send branch to Hatchways and bump version to 1.2.0 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
etchao authored Jun 30, 2023
1 parent d0faf76 commit f3f18e3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hatchways-action",
"version": "1.1.0",
"version": "1.2.0",
"description": "GitHub Action for sending test results to the Hatchways Platform",
"main": "lib/main.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ async function run(): Promise<void> {
)

let commitSha = null
let branch = null
if (github.context.eventName === 'pull_request') {
commitSha = (github.context.payload as PullRequestEvent).pull_request.head
.sha
branch = process.env.GITHUB_HEAD_REF
} else if (github.context.eventName === 'push') {
commitSha = (github.context.payload as PushEvent).after
branch = process.env.GITHUB_REF_NAME
} else {
core.setFailed(
'Only `push` and `pull_request` workflow triggers are supported by the Hatchways GitHub action.'
Expand All @@ -58,8 +61,9 @@ async function run(): Promise<void> {
}

formData.append('commitSha', commitSha)
formData.append('branch', branch)

core.notice(`Updating Hatchways about ${process.env.GITHUB_REPOSITORY}`)
core.notice(`Updating Hatchways about ${process.env.GITHUB_REPOSITORY} on branch ${branch}`)

let statusCode
try {
Expand Down

0 comments on commit f3f18e3

Please sign in to comment.