3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 17
17
JIRA_BASE_URL : ${{ secrets.JIRA_BASE_URL }}
18
18
JIRA_USER_EMAIL : ${{ secrets.JIRA_USER_EMAIL }}
19
19
JIRA_API_TOKEN : ${{ secrets.JIRA_API_TOKEN }}
20
-
20
+
21
21
- name : Create new issue
22
22
id : create
23
23
uses : atlassian/gajira-create@master
30
30
Compare branch|${{ github.event.compare }} # https://developer.github.com/v3/activity/events/types/#webhook-payload-example-31
31
31
32
32
33
+ - name : Transition issue
34
+ uses : ./
35
+ with :
36
+ issue : ${{ steps.create.outputs.issue }}
37
+ transition : " To Do"
38
+
33
39
- name : Transition issue
34
40
uses : ./
35
41
with :
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ const fs = require('fs')
2
2
const YAML = require ( 'yaml' )
3
3
const core = require ( '@actions/core' )
4
4
5
- const cliConfigPath = `${ process . env . HOME } /.jira.d/config.yml`
6
5
const configPath = `${ process . env . HOME } /jira/config.yml`
7
6
const Action = require ( './action' )
8
7
@@ -19,12 +18,11 @@ async function exec () {
19
18
} ) . execute ( )
20
19
21
20
if ( result ) {
22
- const yamledResult = YAML . stringify ( result )
23
21
const extendedConfig = Object . assign ( { } , config , result )
24
22
25
23
fs . writeFileSync ( configPath , YAML . stringify ( extendedConfig ) )
26
24
27
- return fs . appendFileSync ( cliConfigPath , yamledResult )
25
+ return
28
26
}
29
27
30
28
console . log ( 'Failed to transition issue.' )
@@ -38,14 +36,16 @@ async function exec () {
38
36
function parseArgs ( ) {
39
37
const transition = core . getInput ( 'transition' )
40
38
const transitionId = core . getInput ( 'transitionId' )
39
+
41
40
if ( ! transition && ! transitionId ) {
42
41
// Either transition _or_ transitionId _must_ be provided
43
- throw new Exception ( " Error: please specify either a transition or transitionId" )
42
+ throw new Error ( ' Error: please specify either a transition or transitionId' )
44
43
}
44
+
45
45
return {
46
46
issue : core . getInput ( 'issue' ) ,
47
47
transition,
48
- transitionId
48
+ transitionId,
49
49
}
50
50
}
51
51
0 commit comments