Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
fix(chore): dependabot github automation (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
sc979 committed Feb 3, 2022
1 parent c9bfb8c commit b3d79c6
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/dependabot_jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
types: [ opened, reopened ]
branches: [ develop ]

permissions:
pull-requests: read

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

jobs:
create_ticket:
Expand All @@ -19,21 +23,31 @@ 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
with:
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
uses: atlassian/gajira-create@v2.0.1
id: create
with:
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 }}
summary: |
Expand Down Expand Up @@ -61,5 +75,5 @@ jobs:
"customfield_10866": "${{ env.CURRENT_DATE }}",
"labels": ["Dependabot"],
"priority": {"name": "Highest"},
"components":[{"name": "centreon-gorgone"}]
"components":[{"name": "${{ env.COMPONENT_NAME }}"}]
}'

0 comments on commit b3d79c6

Please sign in to comment.