2.26.0 #91
Workflow file for this run
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
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" |