Skip to content

Commit

Permalink
ARC-1820 Tranfer ownership (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
mboudreau authored Nov 18, 2022
1 parent 23b9748 commit 76589d6
Show file tree
Hide file tree
Showing 16 changed files with 35,998 additions and 1,931 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

[*.{js,jsx,json,ts,tsx,yml}]
indent_size = 2
indent_style = tab
tab_width = 2
12 changes: 6 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "@atlassian-partner-engineering",
"rules": {
"no-plusplus": "off"
}
}
"extends": [
"eslint:recommended"
],
"rules": {
}
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @atlassian/fusion-arc
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**What's in this PR?**

**Why**

**Affected issues**
_Jira Issues_

**How has this been tested?**
_Include how to test if applicable_

**Whats Next?**
13 changes: 5 additions & 8 deletions .github/workflows/comment.yml → .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
on:
push
on: push

name: Test comment

Expand All @@ -22,12 +21,10 @@ jobs:
id: create
uses: atlassian/gajira-create@master
with:
project: GA
issuetype: Build
summary: |
Issue for comment ${{ github.repository }}
description: |
Compare branch|${{ github.event.compare }} # https://developer.github.com/v3/activity/events/types/#webhook-payload-example-31
project: COM
issuetype: Task
summary: Issue for comment ${{ github.repository }}
description: Compare branch|${{ github.event.compare }} # https://developer.github.com/v3/activity/events/types/#webhook-payload-example-31

- name: Comment on issue
uses: ./
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn precommit
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Jira Comment
Add a comment to an issue

For examples on how to use this, check out the [gajira-demo](https://github.com/atlassian/gajira-demo) repository
> ##### Only supports Jira Cloud. Does not support Jira Server (hosted)
## Usage
Expand All @@ -12,7 +11,7 @@ To add comment to an issue you need to specify an issue key and a comment as act

```yaml
- name: Comment on issue
uses: atlassian/gajira-comment@master
uses: atlassian/gajira-comment@3.0.0
with:
issue: INC-2
comment: ${{ github.event.pusher.name }} pushed to repository: ${{ github.event.repository.full_name }}
Expand Down
1 change: 0 additions & 1 deletion action.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const Jira = require('./common/net/Jira')

module.exports = class {
constructor ({ githubEvent, argv, config }) {
this.Jira = new Jira({
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ inputs:
description: Comment
required: true
runs:
using: 'node12'
using: 'node16'
main: './dist/index.js'
43 changes: 20 additions & 23 deletions common/net/client.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
const fetch = require('node-fetch')
// const moment = require('moment')

module.exports = serviceName => async (state, apiMethod = 'unknown') => {
// const startTime = moment.now()

const response = await fetch(state.req.url, state.req)
const response = await fetch(state.req.url, state.req)

state.res = {
headers: response.headers.raw(),
status: response.status,
}
state.res = {
headers: response.headers?.raw(),
status: response.status,
}

// const totalTime = moment.now() - startTime
// const tags = {
// api_method: apiMethod,
// method: state.req.method || 'GET',
// response_code: response.status,
// service: serviceName,
// }
// const tags = {
// api_method: apiMethod,
// method: state.req.method || 'GET',
// response_code: response.status,
// service: serviceName,
// }

state.res.body = await response.text()
state.res.body = await response.text()

const isJSON = (response.headers.get('content-type') || '').includes('application/json')
const isJSON = (response.headers.get('content-type') || '').includes('application/json')

if (isJSON && state.res.body) {
state.res.body = JSON.parse(state.res.body)
}
if (isJSON && state.res.body) {
state.res.body = JSON.parse(state.res.body)
}

if (!response.ok) {
throw new Error(response.statusText)
}
if (!response.ok) {
throw new Error(response.statusText)
}

return state
return state
}
32,513 changes: 32,512 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/sourcemap-register.js

Large diffs are not rendered by default.

Loading

0 comments on commit 76589d6

Please sign in to comment.