Skip to content

feat: add issue export #1

feat: add issue export

feat: add issue export #1

name: Add Issue to DevRel Project Management
on:
issues:
types: [opened]
jobs:
transfer:
runs-on: ubuntu-latest
steps:
- name: Transfer Issue
uses: actions/github-script@v5
with:
github-token: ${{secrets.GH_TOKEN}}
script: |
const issueTitle = context.payload.issue.title;
const issueBody = context.payload.issue.body;
const issueNumber = context.payload.issue.number;
const organizationName = 'near';
const projectName = 'DevRel';
// Fetch project ID and other necessary IDs
const query = `
query {
organization(login: "${organizationName}") {
projectV2(number: 117) {
id
}
}
}
`;
const projectIdResponse = await github.graphql(query);
const projectId = projectIdResponse.organization.projectV2.id;
// Add issue to the project
const mutation = `
mutation($projectId: ID!, $contentId: ID!) {
addProjectV2ItemById(input: {projectId: $projectId, contentId: $contentId}) {
item {
id
}
}
}
`;
await github.graphql(mutation, { projectId: projectId, contentId: context.payload.issue.node_id });
g

Check failure on line 48 in .github/workflows/issue-transfer copy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/issue-transfer copy.yml

Invalid workflow file

You have an error in your yaml syntax on line 48