Add comment to closed Jira issues on transition #2
This file contains hidden or 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: Update Jira Status - Done | ||
|
Check failure on line 1 in .github/workflows/main_update_jira_status_to_done.yml
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| caller_jira_auth: | ||
| required: true | ||
| jobs: | ||
| extract: | ||
| uses: scylladb/github-automation/.github/workflows/extract_jira_keys.yml@main | ||
| with: | ||
| pr_title: ${{ github.event.pull_request.title }} | ||
| pr_body: ${{ github.event.pull_request.body }} | ||
| debug: | ||
| needs: extract | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Debug data | ||
| env: | ||
| GITHUB_CONTEXT: ${{ toJson(github) }} | ||
| run: | | ||
| echo "event_name='${{ github.event_name }}'" | ||
| echo "action='${{ github.event.action }}'" | ||
| echo "jira-keys-json='${{ needs.extract.outputs['jira-keys-json'] }}'" | ||
| echo "~~~~~~~~~~~ GitHub Context ~~~~~~~~~~~" | ||
| echo "$GITHUB_CONTEXT" | ||
| details: | ||
| needs: extract | ||
| uses: scylladb/github-automation/.github/workflows/extract_jira_issue_details.yml@automation-staging-branch | ||
| with: | ||
| jira_keys_json: ${{ needs.extract.outputs['jira-keys-json'] }} | ||
| secrets: | ||
| jira_auth: ${{ secrets.caller_jira_auth }} | ||
| apply_labels: | ||
| needs: [extract, details] | ||
| uses: scylladb/github-automation/.github/workflows/apply_labels_to_pr.yml@automation-staging-branch | ||
| with: | ||
| pr_number: ${{ github.event.pull_request.number }} | ||
| labels_csv: ${{ needs.details.outputs.labels_csv }} | ||
| transition: | ||
| needs: [extract, details] | ||
| uses: scylladb/github-automation/.github/workflows/jira_transition.yml@automation-staging-branch | ||
| with: | ||
| details_csv: ${{ needs.details.outputs.csv }} # full CSV text | ||
| transition_name: "Done" | ||
| transition_id: "141" | ||
| secrets: | ||
| jira_auth: ${{ secrets.caller_jira_auth }} | ||
| # Add a descriptive comment to the closed issue | ||
| add_comment: | ||
| needs: [extract, transition] | ||
| # Expand each Jira key into a separate workflow run | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| jira_key: ${{ fromJson(needs.extract.outputs['jira-keys-json']) }} | ||
| # Skip fake placeholder key | ||
| if: ${{ matrix.jira_key != '__NO_KEYS_FOUND__' }} | ||
| # Call the reusable workflow | ||
| uses: scylladb/github-automation/.github/workflows/jira_add_comment.yml@automation-staging-branch | ||
| with: | ||
| jira_key: ${{ matrix.jira_key }} | ||
| comment: > | ||
| This issue was closed due to the merge of PR | ||
| [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }}). | ||
| secrets: | ||
| jira_auth: ${{ secrets.caller_jira_auth }} | ||