Skip to content

feat: automatic project management #37

feat: automatic project management

feat: automatic project management #37

on:
issues:
types:
- opened
push:
jobs:
# issue-assignee:
# runs-on: ubuntu-latest
# steps:
# - name: Assignee
# uses: actions/github-script@v3
# with:
# github-token: ${{ secrets.ISSUES }}
# script: |
# const assignee = 'Robso-creator'; // Substitua pelo nome do responsável
# const issueNumber = 22;
# const repo = context.repo.repo;
#
# try {
# // Atribuir o responsável à issue
# await github.issues.addAssignees({
# owner: context.repo.owner,
# repo: repo,
# issue_number: issueNumber,
# assignees: [assignee],
# });
#
# console.log(`Responsável ${assignee} atribuído à issue #${issueNumber}`);
# } catch (error) {
# console.error('Erro ao atribuir responsável à issue:', error.message);
# process.exit(1);
# }
add-to-project:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Atribuir Issue a Projeto
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue_number = 22;
const project_id = "2"; // Substitua pelo ID do seu projeto
const { data: columns } = await github.projects.listColumns({
project_id: project_id,
});
# // Supondo que você deseja adicionar a issue à primeira coluna do projeto
# const column_id = columns[0].id;
#
# await github.projects.createCard({
# column_id: column_id,
# content_id: context.payload.issue.id,
# content_type: "Issue",
# });