Workflow para criar issue quando uma estrela é dada #21
Workflow file for this run
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: Criar Issue de Boas Vindas ao Adicionar Estrela | |
| on: | |
| watch: | |
| types: [started] | |
| workflow_dispatch: | |
| pull_request: | |
| permissions: | |
| issues: write # Adicione esta linha para permitir a escrita em issues | |
| jobs: | |
| create_issue: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout do repositório | |
| uses: actions/checkout@v4 | |
| - name: Set up GitHub user | |
| id: get_user | |
| run: | | |
| echo "USERNAME=$(jq -r .sender.login $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | |
| - name: Criar um arquivo de issue personalizado | |
| id: create_file | |
| run: | | |
| USERNAME=${{ env.USERNAME }} | |
| TEMPLATE_PATH=".github/ISSUE_TEMPLATE/olar.md" | |
| ISSUE_FILE=".github/ISSUE_TEMPLATE/issue_temp.md" | |
| # Verifica se a variável USERNAME está definida | |
| if [ -z "$USERNAME" ]; then | |
| echo "USERNAME não está definido." | |
| exit 1 | |
| fi | |
| # Remove o arquivo temporário se ele já existir | |
| if [ -f "$ISSUE_FILE" ]; then | |
| echo "Removendo arquivo existente: $ISSUE_FILE" | |
| rm $ISSUE_FILE | |
| fi | |
| # Substitui @seu_nome_de_usuário pelo nome do usuário no template | |
| sed "s/seu_nome_de_usuário/${USERNAME}/g" $TEMPLATE_PATH > $ISSUE_FILE | |
| - name: Criando uma issue de boas-vindas | |
| uses: peter-evans/create-issue-from-file@v4 | |
| with: | |
| title: "Boas vindas ao GitCaos 🔥!" | |
| content-filepath: .github/ISSUE_TEMPLATE/issue_temp.md | |
| labels: 'praticando-na-solidão' | |
| assignees: ${{ env.USERNAME }} # Use a variável de ambiente aqui |