deskflow/.github/workflows/issue-check-support.yml
2024-09-06 14:13:36 +01:00

54 lines
1.7 KiB
YAML

name: Check if tech support issue
on:
issues:
types: [opened]
workflow_dispatch:
inputs:
issue_number:
description: "Issue number"
required: true
issue_body:
description: "Issue body"
required: true
jobs:
issue-check-support:
runs-on: ubuntu-latest
env:
ISSUE_BODY: ${{ github.event.issue.body || github.event.inputs.issue_body }}
ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.issue_number }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python venv
uses: ./.github/actions/init-python
with:
cache-key: "issue-check-support"
- name: Check issue
id: issue-check
run: ./scripts/github.py --issue-check-tech-support
- name: Add comment for customer
if: steps.issue-check.outputs.may-need-tech-support == 'true'
env:
COMMENT_BODY: |
Hello! :wave: As a customer, you're entitled to tech support which is included in your
license at no extra cost.
Please [raise a support ticket](https://symless.com/synergy/contact) if you'd like to
take advantage of that.
If that works for you, then please let us know your ticket number so we can continue
the discussion there. Thanks!
uses: actions/github-script@v6
with:
script: |
body = process.env.COMMENT_BODY
body = body.replace(/\\n/g, '\n')
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number || github.event.inputs.issue_number,
body
});