srggrs / assign-one-project-github-action Goto Github PK
View Code? Open in Web Editor NEWAutomatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
License: MIT License
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
License: MIT License
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.
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 ;-)
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')
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'
Demonstration of assignment of a not labelled issue
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)
Hi, great action - thanks for sharing! I would suggest to include a link to the github actions tutorial in the readme to make things easier for people who are new to actions (including me :)
https://docs.github.com/en/free-pro-team@latest/actions/quickstart
Looks like it's possible to pick the position of a card via API: https://developer.github.com/v3/projects/cards/#move-a-project-card
Ideally, I'd like to be able to assign an issue to a project into a specific column (which works great!) but put it at the bottom. Currently this action puts the card at the top of the column.
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 ๐
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"
}
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"
}
We want to use this action to add PRs from a repo to an organisation project.
We want to know what are the minimal permissions needed.
write:org
?read:org
?admin:org
?Demonstration of assignment to "Labeled" column of project Label Assignment when tagging with "bug" label
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).
Steps to reproduce:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.