Skip to content

[Bug] case-fields for parse_junit is not updating the variables in the testrun #83

[Bug] case-fields for parse_junit is not updating the variables in the testrun

[Bug] case-fields for parse_junit is not updating the variables in the testrun #83

name: Create JIRA Ticket
on:
issues:
types: [opened, labeled]
jobs:
create_jira_ticket:
runs-on: ubuntu-latest
steps:
- name: Check for 'Bug' label
id: check_label
if: contains(join(github.event.issue.labels.*.name, ','), 'Bug')
run: echo "has_label=true" >> $GITHUB_OUTPUT
- name: Set up Node.js
if: steps.check_label.outputs.has_label == 'true'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install md-to-adf
if: steps.check_label.outputs.has_label == 'true'
run: npm install -g md-to-adf
- name: Convert issue body to ADF
id: convert_adf
if: steps.check_label.outputs.has_label == 'true'
run: |
ADF_JSON=$(echo "${{ github.event.issue.body }}" | md-to-adf)
ADF_JSON_ESCAPED=$(echo "$ADF_JSON" | jq -c .)
echo "adf=$ADF_JSON_ESCAPED" >> $GITHUB_OUTPUT
- name: Create JIRA ticket
if: steps.check_label.outputs.has_label == 'true'
env:
JIRA_USER: ${{ secrets.JIRA_USER }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
JIRA_URL: ${{ secrets.JIRA_URL }}
run: |
curl -s -u "$JIRA_USER:$JIRA_TOKEN" \
-X POST \
-H "Content-Type: application/json" \
--data @- "$JIRA_URL/rest/api/3/issue" <<EOF
{
"fields": {
"project": { "key": "${JIRA_PROJECT}" },
"summary": "${{ github.event.issue.title }}",
"description": ${{ steps.convert_adf.outputs.adf }},
"issuetype": { "name": "Bug" },
"labels": ["TRCLI"],
"components": [{ "name": "CLI" }]
}
}
EOF