-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update git-issue-jira-automation workflow #108
Open
OriBenHur-akeyless
wants to merge
9
commits into
master
Choose a base branch
from
ASM-6353/git-issue-automation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7e0143b
Update git-issue-jira-automation workflow
OriBenHur-akeyless 05b7e38
Update version
OriBenHur-akeyless 2371b20
Sand message only on ticket creation
OriBenHur-akeyless 8b2e216
Using a dedicated Slack channel
OriBenHur-akeyless 333af56
Merge branch 'master' into ASM-6353/git-issue-automation
OriBenHur-akeyless 28bdc86
Bump version
OriBenHur-akeyless 3ca3930
Merge branch 'master' into ASM-6353/git-issue-automation
OriBenHur-akeyless 8c35e44
Bump version
OriBenHur-akeyless 26274d8
Merge branch 'master' into ASM-6353/git-issue-automation
OriBenHur-akeyless File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
89 changes: 89 additions & 0 deletions
89
.github/workflows/reusable-git-issues-jira-automation.yaml
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,89 @@ | ||
name: Reusable Git Issues Jira Automation Pipeline | ||
on: | ||
workflow_call: | ||
inputs: | ||
caller_repo_name: | ||
type: string | ||
|
||
env: | ||
AKEYLESS_JIRA_BASE_URL: ${{ secrets.AKEYLESS_JIRA_BASE_URL }} | ||
AKEYLESS_JIRA_USER_EMAIL: ${{ secrets.AKEYLESS_JIRA_USER_EMAIL }} | ||
AKEYLESS_JIRA_ISSUE_TOKEN: ${{ secrets.AKEYLESS_JIRA_ISSUE_TOKEN }} | ||
caller_repo_name: ${{ inputs.caller_repo_name }} | ||
|
||
jobs: | ||
git-issues-jira-automation: | ||
name: ${{ inputs.caller_repo_name }}-git-issues-jira-automation | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout terraform-provider-akeyless code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: akeyless-community/terraform-provider-akeyless | ||
ref: main | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Akeyless jira | ||
uses: atlassian/gajira-login@master | ||
env: | ||
JIRA_BASE_URL: ${{ secrets.AKEYLESS_JIRA_BASE_URL }} | ||
JIRA_USER_EMAIL: ${{ secrets.AKEYLESS_JIRA_USER_EMAIL }} | ||
JIRA_API_TOKEN: ${{ secrets.AKEYLESS_JIRA_ISSUE_TOKEN }} | ||
|
||
- name: Generate Git Issue Event Description For Jira | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: .github/scripts/git_issues/generate_jira_issue_data.sh | ||
|
||
- name: Find Existing Jira issue | ||
if: env.jira_issue_exist == 'true' | ||
uses: atlassian/gajira-find-issue-key@v3 | ||
with: | ||
string: ${{ env.akeyless_jira_issue }} | ||
|
||
- name: Create Jira issue | ||
if: env.jira_issue_exist == 'false' && github.event.action == 'opened' | ||
id: create-jira-issue | ||
uses: atlassian/gajira-create@v3 | ||
with: | ||
project: ASM | ||
issuetype: Bug-Field | ||
summary: ${{ env.jira_issue_summary }} | ||
description: ${{ env.jira_description }} | ||
fields: ${{ env.jira_fields }} | ||
|
||
- name: Log created issue | ||
if: steps.create-jira-issue.outcome == 'success' | ||
run: echo "Jira Issue ${{ steps.create-jira-issue.outputs.issue }} was created" | ||
|
||
- name: Add Comment On Jira issue | ||
if: env.jira_issue_exist == 'true' && (github.event_name == 'issue_comment' || (github.event_name == 'issues' && github.event.action == 'closed')) | ||
uses: atlassian/gajira-comment@v3 | ||
with: | ||
issue: ${{ env.akeyless_jira_issue }} | ||
comment: ${{ env.jira_description }} | ||
Comment on lines
+59
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove if not used |
||
|
||
- name: Prepare Slack Message On Success | ||
if: env.jira_issue_exist == 'false' && github.event.action == 'opened' | ||
id: slack-message-success-creator | ||
run: | | ||
SLACK_MESSAGE="${jira_description} | ||
*Jira Ticket*: https://akeyless.atlassian.net/browse/${{steps.create-jira-issue.outputs.issue}}" | ||
delimiter="$(openssl rand -hex 8)" | ||
echo "slack-message<<${delimiter}" >> $GITHUB_ENV | ||
echo "${SLACK_MESSAGE//$/%0A}" >> $GITHUB_ENV | ||
echo "${delimiter}" >> $GITHUB_ENV | ||
|
||
- name: Slack Success Notification | ||
if: env.jira_issue_exist == 'false' && github.event.action == 'opened' | ||
uses: rtCamp/action-slack-notify@v2 | ||
env: | ||
SLACK_CHANNEL: 'github-public-repo-issues' | ||
SLACK_COLOR: ${{ job.status }} | ||
SLACK_ICON: https://github.com/rtCamp.png?size=48 | ||
SLACK_TITLE: 'New Git Issue Created' | ||
SLACK_MESSAGE: '${{ env.slack-message }}' | ||
SLACK_USERNAME: githubBot | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_GITHUB_ISSUES_WEBHOOK }} | ||
MSG_MINIMAL: true | ||
SLACK_FOOTER: GitHub Issue To Jira Automation |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this change |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Use Semantic versioning only. Please update the version number before opening a pull request. | ||
v1.7.4 | ||
v1.7.5 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove if not used