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

Why it doesn't work for me #2

Open
BobAnkh opened this issue Jun 30, 2020 · 5 comments
Open

Why it doesn't work for me #2

BobAnkh opened this issue Jun 30, 2020 · 5 comments
Labels
enhancement New feature or request In progress

Comments

@BobAnkh
Copy link

BobAnkh commented Jun 30, 2020

I am facing problem of using your github actions. I configure the AutoPR.yml according to your instructions but it seems not working.

Here is the configuration file:

name: Add Recently Created Pull Requests to Project Column
on:
  schedule:
    - cron: "0/5 * * * *"
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Handle Linux Command
      uses: subhamX/[email protected]
      with:
        ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        COLUMN_NAME: In progress
        PROJECT_URL: https://github.com/BobAnkh/LinuxBeginner/projects/1
        # For User Owned Project -> PROJECT_URL: https://github.com/users/UNAME/projects/1
        REPO_URL: https://github.com/BobAnkh/LinuxBeginner
        # For User Owned Repo -> REPO_URL: https://github.com/UNAME/repo1
    - name: Handle Linux Tool
      uses: subhamX/[email protected]
      with:
        ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        COLUMN_NAME: In progress
        PROJECT_URL: https://github.com/BobAnkh/LinuxBeginner/projects/2
        # For User Owned Project -> PROJECT_URL: https://github.com/users/subhamX/projects/1
        REPO_URL: https://github.com/BobAnkh/LinuxBeginner
        # For User Owned Repo -> REPO_URL: https://github.com/UNAME/repo2

And here is the log of Github Actions titled Handle Linux Command

Run subhamX/[email protected]
(node:2469) UnhandledPromiseRejectionWarning: TypeError: (s || "").replace is not a function
at escapeData (/home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:253:10)
at Command.toString (/home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:247:35)
at issueCommand (/home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:210:30)
at Object.issue (/home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:214:5)
at Object.error (/home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:647:15)
at /home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:166:26
at step (/home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:104:23)
at Object.next (/home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:85:53)
at /home/runner/work/_actions/subhamX/github-project-bot/v1.0.0/dist/index.js:79:71
at new Promise ()
(node:2469) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2469) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

So is there something more I have to configure or is there something I configure it wrong? Please help me! Thank you for your time!

@subhamX
Copy link
Owner

subhamX commented Jul 11, 2020

Hi, the version 1.0.0 doesn't support repository project boards.

In other words, the project URL need to be of form https://github.com/users/subhamX/projects/2 or https://github.com/orgs/creativecommons/projects/7.

@subhamX subhamX self-assigned this Jul 11, 2020
@BobAnkh
Copy link
Author

BobAnkh commented Jul 11, 2020

Thank you for your reply, though I have written an action in my repo myself to achieve this during the period 😂 So don't worry if this is not on your plan.

And if you are going to achieve this, I would like to request this feature:
The action triggered by pull request can add the pull request which is opened from a forked repo to the source repo to project.

Thank you for considering that.

@subhamX subhamX assigned BobAnkh and unassigned subhamX and BobAnkh Jul 11, 2020
@subhamX
Copy link
Owner

subhamX commented Jul 11, 2020

The action triggered by pull request can add the pull request which is opened from a forked repo to the source repo to project.

Thank you for your insights. If I am getting it correctly, isn't this already there?
I mean currently, any PR to the REPO_URL will be added to the project board irrespective of the fact if the PR was opened by the owner or non-owner. The problem with triggering with pull request is that for PRs by non-owners or community members GitHub doesn't trigger the pull-request event(and the workflow). This is the main reason why using cron is better. You can have a look at this issue to get more context.

I will be adding support for repository project boards very soon! Feel free to send PR in case you have worked on it. :)

@BobAnkh
Copy link
Author

BobAnkh commented Jul 11, 2020

Thank you for your reply!

I was troubled with the problem that pr from forked repo cannot be added to project. And I remembered that you have used cron, so I tried it and succeeded. But it results in a long action list full with this action, so I turn the trigger event to check_suite, which also handles the problem and costs less resource. So it seems that it is hard to trigger such kind of action by pr.

I have achieve this with python scripts, using PyGithub. So if you accept python scripts, I can send a PR :)

@subhamX subhamX added the enhancement New feature or request label Jul 15, 2020
@subhamX
Copy link
Owner

subhamX commented Jul 15, 2020

The primary purpose of this action was to handle PRs from community members. If check_suite event triggers the workflow whenever there is a new PR from a community member then it would be a great alternative to current logic.
Saying so, I hope that GitHub list pull requests API adds filtering based on time once it's out of developers preview. It will result in lesser computation and resources without major changes in logic.

Sorry but this action is written in typescript, and I don't think it can use python scripts. Thank you for your insights and help in making this project better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request In progress
Projects
None yet
Development

No branches or pull requests

2 participants