Solicitação de Reembolso #195
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: Solicitação de Reembolso | |
on: | |
workflow_dispatch: | |
inputs: | |
event: | |
description: 'Evento (tag, ex: pybr2022)' | |
required: true | |
person: | |
description: 'Pessoa favorecida do reembolso' | |
required: true | |
value: | |
description: 'Valor total' | |
required: true | |
env: | |
LANG: "pt_BR.UTF-8" | |
jobs: | |
new_issue: | |
name: Cria issue para novo reembolso | |
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-reembolso.md | |
- name: Define título e texto | |
id: script | |
run: | | |
# Título | |
TITLE="Solicitação de Reembolso: $EVENT - $PERSON" | |
# Descrição | |
BODY=`sed "s/<evento>/${EVENT}/" <<< $ISSUE | sed "s/<pessoa_favorecida>/${PERSON}/" | sed "s/<valor>/${VALUE}/"` | |
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 }} | |
PERSON: ${{ github.event.inputs.person }} | |
VALUE: ${{ github.event.inputs.value }} | |
ISSUE: ${{ steps.extract.outputs.body }} | |
- name: Cria issue | |
uses: imjohnbo/issue-bot@v3 | |
with: | |
title: ${{ steps.script.outputs.title }} | |
labels: "Financeiro" | |
body: ${{ env.BODY }} |