зеркало из
1
0
Форкнуть 0
ghas-jira-integration/action.yml

60 строки
2.1 KiB
YAML

name: 'Sync GitHub Advanced Security and Jira'
description: "This helps sync GHAS alerts to JIRA by creating an
issue for each alert."
inputs:
jira_url:
description: 'URL of the JIRA instance'
required: true
jira_user:
description: 'JIRA account with the required permissions'
required: true
jira_token:
description: 'JIRA password or token'
required: true
jira_project:
description: 'JIRA project key'
required: true
jira_labels:
description: 'JIRA bug label(s). (e.g. valid format can be "red-team,blue-team,green-team", or "red-team")
This tool will split the values entered by commas. Spaces in the double quotes
will be respected and saved.'
required: false
github_token:
description: 'GitHub API token with the required permissions'
required: false
default: ${{ github.token }}
sync_direction:
description: 'Which direction to synchronize in ("gh2jira", "jira2gh" or "both")'
required: false
default: 'both'
issue_end_state:
description: 'Custom end state'
required: false
default: 'Done'
issue_reopen_state:
description: 'Custom reopen state'
required: false
default: 'To Do'
runs:
using: composite
steps:
- name: Run GitHub to Jira Sync
working-directory: ${{ github.action_path }}
shell: bash
run: |
pip3 install -r requirements.txt
REPOSITORY_NAME="$(echo "$GITHUB_REPOSITORY" | cut -d/ -f 2)"
./gh2jira sync \
--gh-url "$GITHUB_API_URL" \
--gh-token "${{ inputs.github_token }}" \
--gh-org "$GITHUB_REPOSITORY_OWNER" \
--gh-repo "$REPOSITORY_NAME" \
--jira-url "${{ inputs.jira_url }}" \
--jira-user "${{ inputs.jira_user }}" \
--jira-token "${{ inputs.jira_token }}" \
--jira-project "${{ inputs.jira_project }}" \
--jira-labels "${{ inputs.jira_labels }}" \
--direction "${{ inputs.sync_direction }}" \
--issue-end-state "${{ inputs.issue_end_state }}" \
--issue-reopen-state "${{ inputs.issue_reopen_state }}"