Skip to content

Commit 734aa4d

Browse files
committed
Fixed issue with organization projects
1 parent 9d137bc commit 734aa4d

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

.github/workflows/issues.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Move issue to 'To do' column if body has a mark 'issue:todo'
11-
uses: fojia/action-move-issues-to-column@master
11+
uses: fojia/action-move-issues-to-column@v1.0.0
1212
with:
1313
project: 'Actions Project'
1414
column: 'To do'
@@ -19,7 +19,7 @@ jobs:
1919
github_token: ${{ secrets.GITHUB_TOKEN }}
2020
marker: 'issue:todo'
2121
- name: Move issue to 'In Progress' column if body has a mark 'issue:inprogress'
22-
uses: fojia/action-move-issues-to-column@master
22+
uses: fojia/action-move-issues-to-column@v1.0.0
2323
with:
2424
project: 'Actions Project'
2525
column: 'In progress'

.github/workflows/prs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Move new issues into Project Board Column
1+
name: Move issues into Project Board Column
22
on:
33
pull_request:
44
types: [ closed ]
@@ -7,8 +7,8 @@ jobs:
77
name: Move issues to repository project column
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Move all issues related to current PR(into main branch) and children PRs to 'Done' column
11-
uses: fojia/action-move-issues-to-column@master
10+
- name: Move all issues related to current PR(into main branch) and child PRs to 'Done' column
11+
uses: fojia/action-move-issues-to-column@v1.0.0
1212
with:
1313
project: 'Actions Project'
1414
column: 'Done'

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
This action allows you to use any of
66
the [issue](https://help.github.com/en/articles/events-that-trigger-workflows#issues-event-issues) webhook events to
7-
create project cards. For example when an `issue` is `opened` create a card in the project column. Or on [pull_request](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) close event move all linked issues(note you should link issues in the Development section of PR ) to this PR or children PRs to specific project column.
7+
create project cards. For example when an `issue` is `opened` create a card in the project column. Or on [pull_request](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) close event move all linked issues(note you should link issues in the Development section of PR ) to this PR or child PRs to specific project column.
88

99
### Issues workflow example
1010
```yml
@@ -65,7 +65,7 @@ jobs:
6565
name: Move issues to repository project column
6666
runs-on: ubuntu-latest
6767
steps:
68-
- name: Move all issues related to current PR(into main branch) and children PRs to 'Done' column
68+
- name: Move all issues related to current PR(into main branch) and child PRs to 'Done' column
6969
uses: fojia/action-move-issues-to-column@master
7070
with:
7171
project: 'Actions Project'
@@ -78,17 +78,17 @@ jobs:
7878
7979
## Workflow options
8080
81-
| Inputs | Description | Values |
82-
|----------------|-----------------------------------------------------------------------------------------------------------|--------------------------------|
83-
| `on` | When the automation is ran | `issues`, `push:pull_request` |
84-
| `types` | The types of event that will trigger a workflow run. | `opened`, `edited`, `closed` |
85-
| `project` | The name of the project | `Action Project` |
86-
| `column` | The column to create the card to | `To do` |
87-
| `github_token` | The personal access token | `${{ secrets.GITHUB_TOKEN }}` |
88-
| `owner` | The Project owner | `fojia` |
89-
| `repo` | The Project repository (if project inside repository) | `action-move-issues-to-column` |
90-
| `type` | Type for project repository, user or organization project. Default `repo` | `repo`, `user`, `org` |
91-
| `branch` | Base branch. All issues related this PR and children PR issues will move to the specific project column. | `main` |
81+
| Inputs | Description | Values |
82+
|----------------|--------------------------------------------------------------------------------------------------------|--------------------------------|
83+
| `on` | When the automation is ran | `issues`, `push:pull_request` |
84+
| `types` | The types of event that will trigger a workflow run. | `opened`, `edited`, `closed` |
85+
| `project` | The name of the project | `Action Project` |
86+
| `column` | The column to create the card to | `To do` |
87+
| `github_token` | The personal access token | `${{ secrets.GITHUB_TOKEN }}` |
88+
| `owner` | The Project owner | `fojia` |
89+
| `repo` | The Project repository (if project inside repository) | `action-move-issues-to-column` |
90+
| `type` | Type for project repository, user or organization project. Default `repo` | `repo`, `user`, `org` |
91+
| `branch` | Base branch. All issues related this PR and child PR issues will moved to the specific project column. | `main` |
9292

9393
## Personal access token
9494

dist/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8553,7 +8553,7 @@ async function getRepositoryProjects(owner, repo, projectName) {
85538553
}
85548554

85558555
async function getOrganizationProjects(owner, projectName) {
8556-
const {repository: {projects: {nodes: projects}}} = await graphqlApi.query(
8556+
const {organization: {projects: {nodes: projects}}} = await graphqlApi.query(
85578557
`query ($owner: String!, $projectName: String!) {
85588558
organization(login: $owner) {
85598559
projects(search: $projectName, last: 1, states: [OPEN]) {

src/queries.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ async function getRepositoryProjects(owner, repo, projectName) {
121121
}
122122

123123
async function getOrganizationProjects(owner, projectName) {
124-
const {repository: {projects: {nodes: projects}}} = await graphqlApi.query(
124+
const {organization: {projects: {nodes: projects}}} = await graphqlApi.query(
125125
`query ($owner: String!, $projectName: String!) {
126126
organization(login: $owner) {
127127
projects(search: $projectName, last: 1, states: [OPEN]) {

0 commit comments

Comments
 (0)