Skip to content

2.28.1

2.28.1 #94

Workflow file for this run

name: Jira release creator
on:
release:
types: [published]
jobs:
create-ticket:
runs-on: ubuntu-22.04
name: Create a CCB ticket in Jira
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
coverage: none
- name: Install dependencies
run: composer install --optimize-autoloader --no-interaction
- name: Generate Jira ticket body
env:
GITHUB_ACTIONS_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
RELEASE_BODY: ${{ github.event.release.body }}
JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }}
run: |
${GITHUB_WORKSPACE}/.github/workflows/create-ccb-ticket.sh "$RELEASE_BODY" "${{ github.event.release.name }}" "${{ github.event.release.html_url }}" "$GITHUB_ACTIONS_RUN_URL" "$JIRA_BASE_URL" >> jira_description.md
JIRA_DESCRIPTION=$(<jira_description.md)
echo "JIRA_DESCRIPTION<<EOF" >> $GITHUB_ENV
echo "$JIRA_DESCRIPTION" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
shell: bash
- name: Login to Jira
uses: acquia/gajira-login@master
env:
JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
- name: Create fix version
run: |
curl --request POST \
--url "$JIRA_BASE_URL/rest/api/2/version" \
--user "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data "{
\"name\": \"$FIX_VERSION\",
\"projectId\": 20084
}"
env:
JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
FIX_VERSION: Acquia CLI ${{ github.event.release.name }}
- name: Create CCB ticket in Jira
id: create
uses: acquia/gajira-create@master
with:
project: CLI
issuetype: Release
summary: "${{ env.FIX_VERSION }}"
description: "${{ env.JIRA_DESCRIPTION }}"
fields: '{"components": [{"id": "25474"}], "labels": ["ccb_std_017"], "customfield_10004": {"id": "15710"}, "fixVersions": [{"name": "${{ env.FIX_VERSION }}"}], "assignee": {"accountId": "557058:df0e42b9-d76b-4ce6-9bee-144003450bff"}}'
env:
FIX_VERSION: Acquia CLI ${{ github.event.release.name }}
- name: Send for review
uses: acquia/gajira-transition@master
with:
issue: ${{ steps.create.outputs.issue }}
transition: Send for review
- name: Log created issue
run: echo "Issue ${{ steps.create.outputs.issue }} was created"