Robso-creator / discord_bot

This is a Discord bot project developed in Python that offers a variety of features to enhance the user experience on Discord servers. The bot was created to be flexible, user-friendly, and expandable, allowing customization of commands and integration with other services.
MIT License
0 stars 0 forks source link

Assgn automatico para issues #20

Closed Robso-creator closed 9 months ago

Robso-creator commented 9 months ago

Descrição da Tarefa

Critérios de Aceitação

Contexto Adicional

name: Automatic Assignee
on:
  issues:
    types:
      - opened

jobs:
  assignee:
    runs-on: ubuntu-latest
    steps:
      - name: Assignee
        uses: actions/github-script@v8
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            const assignees = ['seu-usuario'];  // Substitua 'seu-usuario' pelo nome de usuário desejado
            const issueNumber = context.issue.number;
            const repo = context.repo.repo;

            await github.issues.addAssignees({
              owner: context.repo.owner,
              repo: repo,
              issue_number: issueNumber,
              assignees: assignees,
            });

Mover automaticamente para backlog do projeto:

jobs:
  configure_issue:
    runs-on: ubuntu-latest
    steps:
      - name: Configure Issue
        uses: actions/github-script@v8
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            const projectName = 'Nome do Seu Projeto';  // Substitua pelo nome do seu projeto
            const columnName = 'A fazer';  // Substitua pelo nome da coluna do seu projeto
            const issueNumber = context.issue.number;
            const repo = context.repo.repo;

            // Adicionar à coluna do projeto
            const project = await github.projects.getRepoProjects({
              owner: context.repo.owner,
              repo: repo,
            });

            const projectColumn = await github.projects.getProjectColumn({
              column_id: project.data[0].columns.find(col => col.name === columnName).id,
            });

            await github.projects.moveProjectCard({
              card_id: issue.data.cards[0].id,
              position: 'top',
              column_id: projectColumn.data.id,
            });

            // Definir um status
            await github.repos.createCommitStatus({
              owner: context.repo.owner,
              repo: repo,
              sha: context.sha,
              state: 'success',  // Substitua pelo status desejado ('success', 'failure', 'pending', etc.)
              context: 'automatic-configure-issue',
              description: 'Configuração automática da issue',
            });