srggrs / assign-one-project-github-action

Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

project not found

GRBurst opened this issue Β· comments

Hey there πŸ‘‹ and thanks for this amazing action.

Sadly, I am getting this error when running this action:

Run srggrs/assign-one-project-github-action@1.2.0
/usr/bin/docker run --name srggrsassignoneprojectgithubaction120_2c2dc5 --label c27d31 --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_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -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/[org/repo/repo]":"/github/workspace" srggrs/assign-one-project-github-action:1.2.0  "https://github.com/[org/repo]/projects/1" ""
jq: error (at <stdin>:4): Cannot index string with string "html_url"
No project was found.
jq: error (at <stdin>:4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.

I have no other actions in the repo defined. I c&p your example, so my action looks like this:

name: Auto Assign to Project(s)

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

jobs:
  assign_one_project:
    runs-on: ubuntu-latest
    name: Assign to Project
    steps:
    - name: Assign NEW issues and NEW pull requests to [project] project (project 1)
      uses: srggrs/assign-one-project-github-action@1.2.0
      with:
        project: 'https://github.com/[org/project]/projects/1'

Trying to use column_name without a value gives the same error and further an error is shown in the github ui when editing the action.

Note: I used [] for placeholders for real values, e.g. in the project url ;-)

commented

I'm not sure what is going on in your case... but as you can see in this Issue, the action worked as expected, and assign your opened issue to the project Towards Usability as mentioned in the notifications above github-actions bot added this to To do in Towards Usability 2 days ago.

Have a look at my workflow file in here.

I suggest to check:

  • the right url of your project
  • the token, especially for repo owned by an organisation

Let me know how it goes! πŸ˜„

@srggrs thanks for the reply. I double checked again and found that the GITHUB_TOKEN is a predefined action token, like mentioned here About GITHUB_TOKEN.

Now everything is working fine πŸ‘

@GRBurst I am having the same issue, I was wondering what you did to resolve it?

@gracetangg sorry, being off the radar lately. Do you still face the issue? The solution for me was to use the mentioned GITHUB_TOKEN instead of defining my own one.

@GRBurst Your good, I did that and it worked. Thanks!

@GRBurst @gracetangg @srggrs I'm trying to do the same thing what you guys were saying.

name: Auto Assign to Project(s)
on:
issues:
types: [opened]
env:
MY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
assign_one_project:
runs-on: ubuntu-latest
name: Assign to One Project
steps:
- name: Assign NEW issues to Kanban
uses: srggrs/assign-one-project-github-action@1.2.1
if: github.event.action == 'opened'
with:
project: 'https://github.com/users/saideep2000/projects/2'
column_name: 'Backlog'

I make sured that the project link is correct and even the cloumn name is correct and also using MY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} for my predefined token to generate.

But still I'm getting the error, can you point me where I'm going wrong with this. I also saw the documentation but I don't know where to actually see to solve this.

jq: error (at :4): Cannot index string with string "html_url"
No project was found.
jq: error (at :4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.