mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-04 21:49:50 -06:00
chore: Remove GitHub actions to sync issues/PRs to Jira (#16150)
This commit is contained in:
54
.github/workflows/jira-issue-sync.yml
vendored
54
.github/workflows/jira-issue-sync.yml
vendored
@@ -1,54 +0,0 @@
|
||||
name: Create Internal Issue on Jira from Issue
|
||||
|
||||
on:
|
||||
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#issues
|
||||
# https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#issues
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
create-jira-issue-from-labeled-issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Log label
|
||||
if: github.event.label.name != 'internal-priority'
|
||||
run: echo Label is ${{ github.event.label.name }} - skipping next steps
|
||||
|
||||
# https://github.com/atlassian/gajira-login
|
||||
- name: Jira login
|
||||
id: login
|
||||
if: github.event.label.name == 'internal-priority'
|
||||
uses: atlassian/gajira-login@master
|
||||
env:
|
||||
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
|
||||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
|
||||
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
|
||||
|
||||
# https://github.com/atlassian/gajira-create
|
||||
- name: Create TR Jira issue for internal-priority labels
|
||||
id: create_jira_internal_priority_issue
|
||||
if: github.event.label.name == 'internal-priority'
|
||||
uses: atlassian/gajira-create@master
|
||||
with:
|
||||
project: TR
|
||||
issuetype: Bug
|
||||
summary: |
|
||||
${{ github.event.issue.title }}
|
||||
description: |
|
||||
Created via GitHub Action with 'internal-priority' label.
|
||||
# Find all available fields JIRA_BASE_URL/rest/api/3/field
|
||||
fields: '{"customfield_10032": "${{ github.event.issue.html_url }}"}'
|
||||
|
||||
# https://github.com/actions/github-script
|
||||
- name: Add comment to GitHub issue
|
||||
if: github.event.label.name == 'internal-priority'
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: 'Internal Jira issue: [${{ steps.create_jira_internal_priority_issue.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create_jira_internal_priority_issue.outputs.issue }})'
|
||||
})
|
||||
55
.github/workflows/jira-pr-sync.yml
vendored
55
.github/workflows/jira-pr-sync.yml
vendored
@@ -1,55 +0,0 @@
|
||||
name: Create Internal Issue on Jira from PR
|
||||
|
||||
on:
|
||||
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request
|
||||
# https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#pull_request
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
create-jira-issue-from-labeled-pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Log label
|
||||
if: github.event.label.name != 'internal-priority'
|
||||
run: echo Label is ${{ github.event.label.name }} - skipping next steps
|
||||
|
||||
# https://github.com/atlassian/gajira-login
|
||||
- name: Jira login
|
||||
id: login
|
||||
if: github.event.label.name == 'internal-priority'
|
||||
uses: atlassian/gajira-login@master
|
||||
env:
|
||||
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
|
||||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
|
||||
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
|
||||
|
||||
# https://github.com/atlassian/gajira-create
|
||||
- name: Create TR Jira issue for internal-priority labels
|
||||
id: create_jira_internal_priority_issue
|
||||
if: github.event.label.name == 'internal-priority'
|
||||
uses: atlassian/gajira-create@master
|
||||
with:
|
||||
project: TR
|
||||
issuetype: Bug
|
||||
summary: |
|
||||
${{ github.event.pull_request.title }}
|
||||
description: |
|
||||
Created via GitHub Action with 'internal-priority' label.
|
||||
# Find all available fields JIRA_BASE_URL/rest/api/3/field
|
||||
fields: '{"customfield_10032": "${{ github.event.pull_request.html_url }}"}'
|
||||
|
||||
|
||||
# https://github.com/actions/github-script
|
||||
- name: Add comment to GitHub PR
|
||||
if: github.event.label.name == 'internal-priority'
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.payload.pull_request.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: 'Internal Jira issue: [${{ steps.create_jira_internal_priority_issue.outputs.issue }}](${{ secrets.JIRA_BASE_URL }}/browse/${{ steps.create_jira_internal_priority_issue.outputs.issue }})'
|
||||
})
|
||||
Reference in New Issue
Block a user