Skip to content

Solicitação de Invoice #1

Solicitação de Invoice

Solicitação de Invoice #1

name: Solicitação de Invoice
on:
workflow_dispatch:
inputs:
event:
description: 'Evento (tag, ex: pybr2022)'
required: true
sponsor:
description: 'Nome do patrocinador'
required: true
type_of_currency:
description: 'Tipo de moeda'
required: true
value:
description: 'Valor'
required: true
env:
LANG: "pt_BR.UTF-8"
jobs:
new_issue:
name: Cria issue para nova invoice
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
issues: write
steps:
- name: Configura locale
run: |
sudo locale-gen pt_BR.UTF-8
sudo update-locale LANG=pt_BR.UTF-8
- name: Template da issue
uses: imjohnbo/[email protected]
id: extract
with:
path: .github/ISSUE_TEMPLATE/solicitacao-invoice.md
- name: Define título e texto
id: script
run: |
# Título
TITLE="Solicitação de Invoice: $EVENT - $SPONSOR"
# Descrição
BODY=`sed "s/<evento>/${EVENT}/" <<< $ISSUE | sed "s/<patrocinador>/${SPONSOR}/" | sed "s/<valor>/${VALUE}/" | sed "s/<moeda>/${TYPE_OF_CURRENCY}/"`
echo "::set-output name=title::$TITLE"
# Hack: set-output não suporta multilinhas
echo "BODY<<EOF" >> $GITHUB_ENV
echo "$BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
EVENT: ${{ github.event.inputs.event }}
SPONSOR: ${{ github.event.inputs.sponsor }}
VALUE: ${{ github.event.inputs.value }}
TYPE_OF_CURRENCY: ${{ github.event.inputs.type_of_currency }}
ISSUE: ${{ steps.extract.outputs.body }}
- name: Cria issue
uses: imjohnbo/issue-bot@v3
with:
title: ${{ steps.script.outputs.title }}
labels: "Financeiro"
body: ${{ env.BODY }}