Commit de6aa5e9 authored by sc979's avatar sc979 Committed by schapron
Browse files

fix(chore): dependabot github automation (#48)

parent f968f1d5
...@@ -5,9 +5,13 @@ on: ...@@ -5,9 +5,13 @@ on:
types: [ opened, reopened ] types: [ opened, reopened ]
branches: [ develop ] branches: [ develop ]
permissions:
pull-requests: read
env: env:
JIRA_PROJECT_KEY: "MON" JIRA_PROJECT_KEY: "MON"
JIRA_ISSUE_TYPE: "Technical" JIRA_ISSUE_TYPE: "Technical"
COMPONENT_NAME: "${{ github.event.pull_request.base.repo.name }}"
jobs: jobs:
create_ticket: create_ticket:
...@@ -19,10 +23,19 @@ jobs: ...@@ -19,10 +23,19 @@ jobs:
id: date id: date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV 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 - name: Login to Jira
uses: atlassian/gajira-login@v2.0.0 uses: atlassian/gajira-login@v2.0.0
id: login id: login
with: env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
...@@ -30,10 +43,11 @@ jobs: ...@@ -30,10 +43,11 @@ jobs:
- name: Create Jira Issue - name: Create Jira Issue
uses: atlassian/gajira-create@v2.0.1 uses: atlassian/gajira-create@v2.0.1
id: create id: create
with: env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
with:
project: ${{ env.JIRA_PROJECT_KEY }} project: ${{ env.JIRA_PROJECT_KEY }}
issuetype: ${{ env.JIRA_ISSUE_TYPE }} issuetype: ${{ env.JIRA_ISSUE_TYPE }}
summary: | summary: |
...@@ -61,5 +75,5 @@ jobs: ...@@ -61,5 +75,5 @@ jobs:
"customfield_10866": "${{ env.CURRENT_DATE }}", "customfield_10866": "${{ env.CURRENT_DATE }}",
"labels": ["Dependabot"], "labels": ["Dependabot"],
"priority": {"name": "Highest"}, "priority": {"name": "Highest"},
"components":[{"name": "centreon-connectors"}] "components":[{"name": "${{ env.COMPONENT_NAME }}"}]
}' }'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment