Skip to content

Commit 0fb280d

Browse files
authoredOct 21, 2020
Merge pull request #13 from atlassian/bugfix/breaking-other-actions-after
Fixed breaking other actions in the flow
2 parents 634d97d + dfc7476 commit 0fb280d

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed
 

‎.github/workflows/transition.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
1818
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
1919
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
20-
20+
2121
- name: Create new issue
2222
id: create
2323
uses: atlassian/gajira-create@master
@@ -30,6 +30,12 @@ jobs:
3030
Compare branch|${{ github.event.compare }} # https://developer.github.com/v3/activity/events/types/#webhook-payload-example-31
3131
3232
33+
- name: Transition issue
34+
uses: ./
35+
with:
36+
issue: ${{ steps.create.outputs.issue }}
37+
transition: "To Do"
38+
3339
- name: Transition issue
3440
uses: ./
3541
with:

‎dist/index.js

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

‎index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const fs = require('fs')
22
const YAML = require('yaml')
33
const core = require('@actions/core')
44

5-
const cliConfigPath = `${process.env.HOME}/.jira.d/config.yml`
65
const configPath = `${process.env.HOME}/jira/config.yml`
76
const Action = require('./action')
87

@@ -19,12 +18,11 @@ async function exec () {
1918
}).execute()
2019

2120
if (result) {
22-
const yamledResult = YAML.stringify(result)
2321
const extendedConfig = Object.assign({}, config, result)
2422

2523
fs.writeFileSync(configPath, YAML.stringify(extendedConfig))
2624

27-
return fs.appendFileSync(cliConfigPath, yamledResult)
25+
return
2826
}
2927

3028
console.log('Failed to transition issue.')
@@ -38,14 +36,16 @@ async function exec () {
3836
function parseArgs () {
3937
const transition = core.getInput('transition')
4038
const transitionId = core.getInput('transitionId')
39+
4140
if (!transition && !transitionId) {
4241
// 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')
4443
}
44+
4545
return {
4646
issue: core.getInput('issue'),
4747
transition,
48-
transitionId
48+
transitionId,
4949
}
5050
}
5151

0 commit comments

Comments
 (0)
Failed to load comments.