Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No project was found" error #65

Open
gilgongo opened this issue Mar 6, 2021 · 18 comments
Open

"No project was found" error #65

gilgongo opened this issue Mar 6, 2021 · 18 comments
Labels
question Further information is requested

Comments

@gilgongo
Copy link

gilgongo commented Mar 6, 2021

Hi, I'm getting the following error on an organization project. Can anyone tell me why it's not recognising the project?

on:
  issues:
    types: [opened]
  pull_request:
    types: [opened]
env:
  MY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  assign_one_project:
    runs-on: ubuntu-latest
    name: Assign to Triage
    steps:
    - name: Put new issues and pull requests into triage
      uses: srggrs/assign-one-project-github-action@1.2.0
      if: github.event.action == 'opened'
      with:
        project: 'https://github.com/orgs/jamulussoftware/projects/2'
        column_name: 'Triage'

Run srggrs/assign-one-project-github-action@1.2.0
/usr/bin/docker run --name srggrsassignoneprojectgithubaction120_1ceb6e --label 5588e4 --workdir /github/workspace --rm -e MY_GITHUB_TOKEN -e INPUT_PROJECT -e INPUT_COLUMN_NAME -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/jamulus/jamulus":"/github/workspace" srggrs/assign-one-project-github-action:1.2.0  "https://github.com/orgs/jamulussoftware/projects/2" "Triage"
No project was found.
jq: error (at <stdin>:4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.
@srggrs srggrs added the bug Something isn't working label Mar 7, 2021
@srggrs
Copy link
Owner

srggrs commented Mar 7, 2021

Hi,

I think there is a missunderstanding in the documentation, sorry about that. Since the action run in a repo that belongs to the organisation and the project belong to the organisation as well you don't need a Personal Access Token. So you need to fix with GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}.

If the action run from a personal repo and target an organisation project, then you need to generate a Personal Access Token with the org permissions (see #58), added in the repository secrets and specify it in the workflow file. Hope that is clearer.

Let me know if that fix your problem.

Cheers,
Sergio

@srggrs srggrs added question Further information is requested and removed bug Something isn't working labels Mar 7, 2021
@gilgongo
Copy link
Author

gilgongo commented Mar 7, 2021

Thanks. I'm not running it from a personal repo, so instead of:

env:
  MY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

I should use:

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

is that right? I think I tried that and got another error before.

@srggrs
Copy link
Owner

srggrs commented Mar 7, 2021

@gilgongo yep exactly. Should work. Let me know how it goes.

@gilgongo
Copy link
Author

gilgongo commented Mar 7, 2021

Unfortunately, it fails with MY_GITHUB_TOKEN not defined :-(

EDIT: I've also tried it now with an organisation secret I created called ORG_SECRET:

MY_GITHUB_TOKEN: ${{ secrets.ORG_SECRET }}

And again got this:

jq: error (at <stdin>:4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.

@srggrs
Copy link
Owner

srggrs commented Mar 7, 2021

Unfortunately, it fails with MY_GITHUB_TOKEN not defined :-(

EDIT: I've also tried it now with an organisation secret I created called ORG_SECRET:

MY_GITHUB_TOKEN: ${{ secrets.ORG_SECRET }}

And again got this:

jq: error (at <stdin>:4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.

you don't need to generate a token and add it to the repository secrets. Try this:

on:
  issues:
    types: [opened]
  pull_request:
    types: [opened]
env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
  assign_one_project:
    runs-on: ubuntu-latest
    name: Assign to Triage
    steps:
    - name: Put new issues and pull requests into triage
      uses: srggrs/assign-one-project-github-action@1.2.0
      if: github.event.action == 'opened'
      with:
        project: 'https://github.com/orgs/jamulussoftware/projects/2'
        column_name: 'Triage'

@gilgongo
Copy link
Author

gilgongo commented Mar 8, 2021

When I try that, I get this I'm afraid:


Run srggrs/assign-one-project-github-action@1.2.0
  with:
    project: https://github.com/orgs/Sasilovistor/projects/1
    column_name: Triage
  env:
    GITHUB_TOKEN: ***
/usr/bin/docker run --name srggrsassignoneprojectgithubaction120_87a3c3 --label 5588e4 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_PROJECT -e INPUT_COLUMN_NAME -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/testing/testing":"/github/workspace" srggrs/assign-one-project-github-action:1.2.0  "https://github.com/orgs/jamulussoftware/projects/2" "Triage"
MY_GITHUB_TOKEN not defined

I also set up a test organisation, and tried tha with MY_GITHUB_TOKEN but get the same thing:

Run srggrs/assign-one-project-github-action@1.2.0
  with:
    project: https://github.com/orgs/Sasilovistor/projects/1
    column_name: Triage
  env:
    MY_GITHUB_TOKEN: ***
/usr/bin/docker run --name srggrsassignoneprojectgithubaction120_dea86f --label 5588e4 --workdir /github/workspace --rm -e MY_GITHUB_TOKEN -e INPUT_PROJECT -e INPUT_COLUMN_NAME -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/testing/testing":"/github/workspace" srggrs/assign-one-project-github-action:1.2.0  "https://github.com/orgs/Sasilovistor/projects/1" "Triage"
No project was found.
jq: error (at <stdin>:4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.

@cpswan
Copy link

cpswan commented Jun 4, 2021

I've hit a similar issue when trying to use a User project. So this config:

      with:
        project: 'https://github.com/users/cpswan/projects/1'

gets me to this log:

Run srggrs/assign-one-project-github-action@1.2.1
  with:
    project: https://github.com/users/cpswan/projects/1
    column_name: Bugs
  env:
    MY_GITHUB_TOKEN: ***
/usr/bin/docker run --name a33c12ef266716b6d4324acb95a279e43649a_87c80e --label 8a33c1 --workdir /github/workspace --rm -e MY_GITHUB_TOKEN -e INPUT_PROJECT -e INPUT_COLUMN_NAME -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/bug_to_project/bug_to_project":"/github/workspace" 8a33c1:2ef266716b6d4324acb95a279e43649a  "https://github.com/users/cpswan/projects/1" "Bugs"
No project was found.
jq: error (at <stdin>:4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.

No such problems when I run the same workflow definition against an org project:

      with:
        project: 'https://github.com/orgs/javagone/projects/1'

@arist0v
Copy link

arist0v commented May 22, 2022

I had similar issue, after a few test, my token didn't had enough privileges, so i add all privileges on the repo and it work

Maybe you should specifies the exact privileges the token need to have for it to work

@arist0v
Copy link

arist0v commented May 22, 2022

16532453105079040813171700614333

@day-jeff
Copy link

day-jeff commented Jul 30, 2022

I was running into this same issue. I tried https://github.com/actions/add-to-project, and it immediately gave me an error message that I needed to add the 'admin:org' and 'read:project' permissions to my PAT. It worked great once I updated my PAT, so I haven't bothered to come back and try to make it work here. Note: I am using one of the new Git org projects, which is still in beta, and it may require different permissions than the classic projects.

@brandonh-msft
Copy link

I've tried everything in this thread:

Repo token as MY_GITHUB_TOKEN

env:
  MY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Repo token as GITHUB_TOKEN

env:
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Custom PAT in my repo, configured per @day-jeff 's comment:

env:
  MY_GITHUB_TOKEN: ${{ secrets.ACTIONS_PAT }}

Nothing works.

I can't pivot to what Jeff highlighted because I want the ability to put a new PR/Issue into a column on the Project, not just label the PRs/issues :/

Any update on what works here?
I have an org-level private project on a public repo

@TElodie
Copy link

TElodie commented Nov 10, 2022

I have the same issue. I tried everything like you and nothing: MY_GITHUB_TOKEN and GITHUB_TOKEN.
Any news about this issue ?

@bashfulrobot
Copy link

bashfulrobot commented Nov 21, 2022

Plus one. Same issues.

In an org, both repo and action, using MY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}.

Results in:

No project was found.
jq: error (at <stdin>:4): Cannot index string with string "name"
Column name '' is not found.

And when changing to GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}, it results is:

MY_GITHUB_TOKEN not defined

🤔

@toco-cam
Copy link

me too

1 similar comment
@r-arteaga
Copy link

me too

@justinr1234
Copy link

Is this ever solved or is there an alternative action I can use?

@MathieuVeber
Copy link

me too

1 similar comment
@Alfagun74
Copy link

me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests