Skip to content

Commit

Permalink
chore(test): test (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
stavares843 authored Oct 4, 2024
1 parent 242029f commit f95ff1c
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/auto-add-issues-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,36 @@ on:
jobs:
add_to_project:
runs-on: ubuntu-latest
permissions:
contents: write # Required permission to modify repository contents
steps:
- name: Add issue to GitHub project
uses: actions/github-script@v6
with:
script: |
const projectOwner = 'Satellite-im';
const projectNumber = 19;
const repoOwner = 'Satellite-im'; // Repository owner (Organization or User)
const repoName = 'UplinkWeb'; // Replace with the repository name
const projectNumber = 19; // The number of the project you want to add issues to
const issueId = context.payload.issue.node_id; // The issue ID from the event payload
const issueId = context.payload.issue.node_id;
const { organization } = await github.graphql(`
query($login: String!, $number: Int!) {
organization(login: $login) {
// GraphQL query to get the project ID from the repository
const { repository } = await github.graphql(`
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
projectV2(number: $number) {
id
}
}
}
`, {
login: projectOwner,
owner: repoOwner,
repo: repoName,
number: projectNumber
});
const projectId = organization.projectV2.id;
const projectId = repository.projectV2.id; // Extract the project ID
// Mutation to add the issue to the project
await github.graphql(`
mutation($projectId: ID!, $issueId: ID!) {
addProjectV2ItemById(input: { projectId: $projectId, contentId: $issueId }) {
Expand Down

0 comments on commit f95ff1c

Please sign in to comment.