-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BC-5988 updated gh-actions added dependabot-to-jira workflow (#31)
- Loading branch information
Showing
5 changed files
with
104 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" # Location of package manifests | ||
open-pull-requests-limit: 5 | ||
versioning-strategy: "increase" | ||
schedule: | ||
interval: "weekly" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
dependabot-to-jira: | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
name: 'dependabot-pr-to-jira' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: create ticket | ||
id: create_ticket | ||
run: | | ||
response_code=$(curl -s \ | ||
-o response.txt \ | ||
-w "%{http_code}" \ | ||
-u ${{ secrets.JIRA_USER_NAME }}:${{ secrets.JIRA_USER_PASSWORD }}\ | ||
-H "Content-Type: application/json" \ | ||
-X POST --data '{ | ||
"fields": { | ||
"project": { | ||
"key": "BC" | ||
}, | ||
"summary": "${{ github.event.pull_request.title }} in ${{ github.event.repository.name }}", | ||
"description": "h4. Task:\n${{ github.event.pull_request.title }}\n${{ github.event.pull_request.html_url }}\nh4.Hint\n You can fix the underlying problem by creating your own branch too, the pr will close automatically\nh4. Acceptance criteria\n1. https://docs.dbildungscloud.de/display/DBH/3rd+Party+Library+Quality+Assessment", | ||
"issuetype": { | ||
"id": "10100" | ||
}, | ||
"customfield_10004" : 231, | ||
"customfield_10000": "BC-3139" | ||
} | ||
}' \ | ||
'https://ticketsystem.dbildungscloud.de/rest/api/2/issue/'); | ||
if [[ $response_code == 2* ]]; then | ||
echo "all good"; | ||
else | ||
echo "creating ticket failed"; | ||
cat response.txt; | ||
exit 1; | ||
fi | ||
created_issue=$(jq -r '.key' response.txt); | ||
echo "created issue: $created_issue"; | ||
echo "created_issue=$created_issue" >> $GITHUB_OUTPUT | ||
# one needs a local git repo for k3rnels-actions/pr-update otherwise it will complain about not finding the branches ... | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: update-pull-request | ||
uses: k3rnels-actions/pr-update@v1 | ||
id: pr_update | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
pr_title: ${{ steps.create_ticket.outputs.created_issue }} - ${{ github.event.pull_request.title }} | ||
pr_body: ${{ github.event.pull_request.body }} | ||
pr_source: ${{ github.event.pull_request.head.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Dependency Review' | ||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout Repository' | ||
uses: actions/checkout@v4 | ||
- name: 'Dependency Review' | ||
uses: actions/dependency-review-action@v3 | ||
with: | ||
allow-licenses: AGPL-3.0-only, LGPL-3.0, MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, X11, 0BSD, GPL-3.0 AND BSD-3-Clause-Clear, Unlicense |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters