Skip to content
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

Feat/el 1021 #41

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: "Bump Version"

on:
push:
branches: [main, master]
on: [pull_request]

jobs:
bump-version:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/new1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check Branch Name and Verify JIRA ID on JIRA Board

on: [push]

jobs:
run-script:
runs-on: ubuntu-latest

steps:
- name: Run If Else Script
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "Event was a push"
else
echo "Event was not a push"
fi

- name: Check Branch Name
id: check-branch
run: |
branch_name="${GITHUB_REF#refs/heads/}"
if [[ $branch_name =~ [A-Z]{2,5}-[0-9]+ ]]; then
echo "Branch name contains a JIRA ID: $branch_name"
echo "::set-output name=jira_id::$branch_name"
else
echo "Branch name does not contain a JIRA ID: $branch_name"
exit 1
fi

- name: Verify JIRA ID on JIRA Board
id: verify-jira-id
run: |
jira_id="${{ steps.check-branch.outputs.jira_id }}"
jira_url="https://your-jira-instance.atlassian.net/rest/api/2/issue/$jira_id"

# Replace 'your-jira-username' and 'your-jira-api-token' with your Jira credentials
curl -u your-jira-username:your-jira-api-token -X GET -H "Content-Type: application/json" $jira_url | grep -q 'id' && echo "JIRA ID $jira_id exists on the JIRA board" || (echo "JIRA ID $jira_id does not exist on the JIRA board" && exit 1)
Loading