Giter VIP home page Giter VIP logo

srggrs / assign-one-project-github-action Goto Github PK

View Code? Open in Web Editor NEW
169.0 5.0 60.0 55 KB

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

License: MIT License

Dockerfile 6.94% Shell 93.06%
github-actions github-action github-actions-docker github-projects management project-management project projects organisation utilities

assign-one-project-github-action's People

Contributors

adamdmharvey avatar mondeja avatar moonlight-komorebi avatar peckjon avatar srggrs avatar sunrunaway avatar tspascoal avatar vishna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

assign-one-project-github-action's Issues

Action fails to find project when there are more than 30 projects

The action can't find the project if there are more than 30 projects, since the API being used to list all projects is paginated and returns at most 30 projects (by default).

If this API is going to be used, then it will need to be paginated.

It would be easier (and faster) to ask for the project id instead of trying to determine it from the URL (a little more work for user but I think a decent tradeoff)

[Feature] Assign issues that have a milestone

Hey there,

is it possible to link milestones to projects, e.g. assigning all issues of a milestone "A" to the provided project? Similar like labels work. I know that I will have to update the action every time I create a new milestone, but that would be fine for me.

Additionally, it would be nice if I can just define that all issues that are assigned to a milestone should be added to the project.

Happy to hear from you ๐ŸŽ‰

Help: Cannot add project into new pull request

I was able to add project into the issue.
but not working on fork pull request.
Am I doing something wrong??

P/S: my orgs repo is private and the fork repo also private

name: Auto PR/Issue Assign to Project(s)

on:
  issues:
    types: [opened, labeled]
  pull_request:
    types: [opened]

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

jobs:
  assign_one_project:
    runs-on: ubuntu-latest
    name: Assign to One Project
    steps:
    - name: Assign NEW issues to project
      uses: srggrs/[email protected]
      if: github.event.action == 'opened'
      with:
        project: 'https://github.com/orgs/example/projects/5'
        column_name: 'To Do'
    
    - name: Assign NEW PR to project
      uses: srggrs/[email protected]
      if: |
        github.event == 'pull_request' &&
        (
          github.event.action == 'opened'
        )
      with:
        project: 'https://github.com/orgs/example/projects/5'
        column_name: 'In Progress'

Error when going from draft PR to normal PR

Steps to reproduce:

  1. create a PR as a draft
  2. mark the PR as ready

Details of the error:

/usr/bin/docker run --name srggrsassignoneprojectgithubaction110_c90efe --label 488dfb --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_PROJECT -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -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 GITHUB_ACTIONS=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/vast-pipeline/vast-pipeline":"/github/workspace" srggrs/assign-one-project-github-action:1.1.0 "https://github.com/askap-vast/askap-pipeline/projects/1"
changing col name for PR event
No project was found.
jq: error (at :4): Cannot index string with string "name"
INITIAL_COLUMN_ID is not found.
##[error]Docker run failed with exit code 1

Move a PR/Issue to another column

Hi, thank you for this great GitHub Action! ๐Ÿ˜€

I try to use this action to move a PR to another column when a label is deleted. However, it couldn't work and give this error message.

Is this a bug or unsupported feature?

{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "ProjectCard",
      "code": "unprocessable",
      "field": "data",
      "message": "Project already has the associated issue"
    }
  ],
  "documentation_url": "https://developer.github.com/v3/projects/cards/#create-a-project-card"
}

new issue labeled

Demonstration of assignment to "Labeled" column of project Label Assignment when tagging with "bug" label

Resource not accessible by integration

Hi there,

Got this message when running the job.
The same workflow runs okay in a personal repo, but not in an organization's repo, so I wonder if it's caused by issues of authorization?

{
  "message": "Resource not accessible by integration",
  "documentation_url": "https://developer.github.com/v3/projects/cards/#create-a-project-card"
}

Assign to project but no column

If you add an Issue to a Project manually, it goes into an Awaiting triage state. Is there a way for this action to allow that? From what I read, if you leave off specifying a column, it will default to To Do (which I'm not using, so not sure what would happen there).

project not found

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

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

Run srggrs/[email protected]
/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/[email protected]
      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 ;-)

A label added by a bot action doesn't trigger

I have this condition that triggers when I manually add a label to the issue.
But when the label is added by a bot from another action, it doesn't work.

Is this the expected behavior?

   if: contains(github.event.issue.labels.*.name, '1 - Planning')

Remove an issue from a project

To start I love what you have implemented. This is definitely very useful in workflow management.

Is it possible to remove an issue from a project?
I'm interested due to the situation when an issue is incorrectly labeled then relabeled I would like to remove it from the project it was initially added to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.