Skip to content

Commit 76589d6

Browse files
authoredNov 18, 2022
ARC-1820 Tranfer ownership (#32)
1 parent 23b9748 commit 76589d6

16 files changed

+35998
-1931
lines changed
 

‎.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.md]
10+
insert_final_newline = false
11+
trim_trailing_whitespace = false
12+
13+
[*.{js,jsx,json,ts,tsx,yml}]
14+
indent_size = 2
15+
indent_style = tab
16+
tab_width = 2

‎.eslintrc.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"extends": "@atlassian-partner-engineering",
3-
"rules": {
4-
"no-plusplus": "off"
5-
}
6-
}
7-
2+
"extends": [
3+
"eslint:recommended"
4+
],
5+
"rules": {
6+
}
7+
}

‎.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @atlassian/fusion-arc

‎.github/pull_request_template.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**What's in this PR?**
2+
3+
**Why**
4+
5+
**Affected issues**
6+
_Jira Issues_
7+
8+
**How has this been tested?**
9+
_Include how to test if applicable_
10+
11+
**Whats Next?**

‎.github/workflows/comment.yml ‎.github/workflows/on-push.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
on:
2-
push
1+
on: push
32

43
name: Test comment
54

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

3229
- name: Comment on issue
3330
uses: ./

‎.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn precommit

‎README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Jira Comment
22
Add a comment to an issue
33

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

1312
```yaml
1413
- name: Comment on issue
15-
uses: atlassian/gajira-comment@master
14+
uses: atlassian/gajira-comment@3.0.0
1615
with:
1716
issue: INC-2
1817
comment: ${{ github.event.pusher.name }} pushed to repository: ${{ github.event.repository.full_name }}

‎action.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const Jira = require('./common/net/Jira')
2-
32
module.exports = class {
43
constructor ({ githubEvent, argv, config }) {
54
this.Jira = new Jira({

‎action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ inputs:
1111
description: Comment
1212
required: true
1313
runs:
14-
using: 'node12'
14+
using: 'node16'
1515
main: './dist/index.js'

‎common/net/client.js

+20-23
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
const fetch = require('node-fetch')
2-
// const moment = require('moment')
32

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

7-
const response = await fetch(state.req.url, state.req)
5+
const response = await fetch(state.req.url, state.req)
86

9-
state.res = {
10-
headers: response.headers.raw(),
11-
status: response.status,
12-
}
7+
state.res = {
8+
headers: response.headers?.raw(),
9+
status: response.status,
10+
}
1311

14-
// const totalTime = moment.now() - startTime
15-
// const tags = {
16-
// api_method: apiMethod,
17-
// method: state.req.method || 'GET',
18-
// response_code: response.status,
19-
// service: serviceName,
20-
// }
12+
// const tags = {
13+
// api_method: apiMethod,
14+
// method: state.req.method || 'GET',
15+
// response_code: response.status,
16+
// service: serviceName,
17+
// }
2118

22-
state.res.body = await response.text()
19+
state.res.body = await response.text()
2320

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

26-
if (isJSON && state.res.body) {
27-
state.res.body = JSON.parse(state.res.body)
28-
}
23+
if (isJSON && state.res.body) {
24+
state.res.body = JSON.parse(state.res.body)
25+
}
2926

30-
if (!response.ok) {
31-
throw new Error(response.statusText)
32-
}
27+
if (!response.ok) {
28+
throw new Error(response.statusText)
29+
}
3330

34-
return state
31+
return state
3532
}

‎dist/index.js

+32,512-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/index.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/sourcemap-register.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Failed to load comments.