.github/workflows/ISSUE_CREATION_WORKFLOW.yml #1
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
# This workflow uses actions that are not certified by GitHub. | |
# São fornecidas por terceiros e regidas por | |
# termos de serviço, política de privacidade e suporte separados | |
# documentação. | |
name: Weekly Team Sync | |
on: | |
workflow_dispatch: | |
inputs: | |
input: | |
description: "Criação de issue" | |
required: false | |
default: "Issue criada" | |
schedule: | |
- cron: 0 12 * * 4 | |
env: | |
MONTH_01: "Janeiro" | |
MONTH_02: "Fevereiro" | |
MONTH_03: "Março" | |
MONTH_04: "Abril" | |
MONTH_05: "Maio" | |
MONTH_06: "Junho" | |
MONTH_07: "Julho" | |
MONTH_08: "Agosto" | |
MONTH_09: "Setembro" | |
MONTH_10: "Outubro" | |
MONTH_11: "Novembro" | |
MONTH_12: "Dezembro" | |
# Change this variable for changing the meeting weekday | |
DATE_WEEKDAY: "wednesday" | |
jobs: | |
create_issue: | |
name: Create team sync issue | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
issues: write | |
steps: | |
- name: Extract issue template and generate title | |
uses: imjohnbo/extract-issue-template-fields@v1 | |
id: extract | |
with: | |
path: .github/ISSUE_TEMPLATE/reuniao.md | |
- name: Get meeting date | |
id: date | |
run: | | |
day=$(date -d "next $DATE_WEEKDAY" +%d) | |
month_num=$(date -d "next $DATE_WEEKDAY" +%m) | |
month_var="MONTH_$month_num" | |
month=$(eval echo ${!month_var}) | |
year=$(date -d "next $DATE_WEEKDAY" +%Y) | |
meeting_date="$day de $month de $year" | |
echo "::set-output name=date::$meeting_date" | |
- name: Create meeting issue | |
uses: imjohnbo/issue-bot@v3 | |
with: | |
assignees: ${{ steps.extract.outputs.assignees }} | |
labels: ${{ steps.extract.outputs.labels }} | |
title: "[Reunião] Geral: ${{ steps.date.outputs.date }}" | |
body: "${{ steps.body.outputs.body }}" | |
project: ${{ steps.extract.outputs.project }} | |
pinned: false | |
close-previous: false |