Skip to content

Commit

Permalink
fix(chore): dependabot github automation (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
sc979 committed Feb 2, 2022
1 parent 468f199 commit 82e6ff2
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions centreon-broker/.github/workflows/dependabot_jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on:
types: [ opened, reopened ]
branches: [ develop ]

permissions:
pull-requests: read

env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT_KEY: "MON"
JIRA_ISSUE_TYPE: "Technical"
COMPONENT_NAME: "${{ github.event.pull_request.base.repo.name }}"

jobs:
create_ticket:
Expand All @@ -22,16 +23,30 @@ jobs:
id: date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV

- name: Check components name
id: name
if: ${{ env.COMPONENT_NAME == 'centreon'}}
run: echo "COMPONENT_NAME=centreon-web" >> $GITHUB_ENV

- name: debug
id: debug
run: echo "component is ${{ env.COMPONENT_NAME }}."

- name: Login to Jira
uses: atlassian/gajira-login@v2.0.0
id: login
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Create Jira Issue
id: create
uses: atlassian/gajira-create@v2.0.1
id: create
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
with:
project: ${{ env.JIRA_PROJECT_KEY }}
issuetype: ${{ env.JIRA_ISSUE_TYPE }}
Expand All @@ -53,13 +68,12 @@ jobs:
*Github Advisory*
fields:
'{
"customfield_10880": "Internal",
"customfield_10881": "Dependabot",
"customfield_10866": "${{ env.CURRENT_DATE }}",
"labels": ["Dependabot"],
"priority": {"name": "Highest"},
"components":[{"name": "centreon-collect"}]
"components":[{"name": "${{ env.COMPONENT_NAME }}"}]
}'

0 comments on commit 82e6ff2

Please sign in to comment.