Git Product home page Git Product logo

add-to-project's People

Contributors

abdelhamid-attaby avatar akashivskyy avatar anthonylaye avatar camchenry avatar codycbakerphd avatar damovisa avatar dependabot[bot] avatar dewski avatar dmarcey avatar endbug avatar iansan5653 avatar jclem avatar joshmgross avatar joshrowley avatar ll782 avatar lonedev6 avatar lukewar avatar mastermedo avatar mattcosta7 avatar omerbensaadon avatar rentziass avatar rootulp avatar saravanan30erd avatar shiftkey avatar skw avatar stephenotalora avatar takost avatar talune avatar timrogers 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  avatar  avatar

add-to-project's Issues

**To Reproduce**

To Reproduce

Unformatted code:

def main():
    if a:

        # Comment
        def b():
            pass

    if b:
        def c():
            pass

Running black --preview:

def main():
    if a:
        # Comment
        def b():
            pass

    if b:

        def c():
            pass

Expected behavior

Empty line should be consistent added (or removed) between the code block open and inner function:

def main():
    if a:

        # Comment
        def b():
            pass

    if b:

        def c():
            pass

Or,

def main():
    if a:
        # Comment
        def b():
            pass

    if b:
        def c():
            pass

Additional context

I did a bisect and this was caused by psf/black#3035.

Note that if the inner function doesn't have a leading comment, it won't remove the empty line:

def main():
    if a:

        def b():
            pass

        def c():
            pass

Thus I believe this is an undesired behavior change in #3035?

Originally posted by @yilei in psf/black#3300

How to add to "To do"?

I am probably missing something obvious, but how do I get the action to add to my project's "To do" list? It is pushing it to a "no label" in the project view. I tried adding labeled: "To do" but that doesn't seem to do the trick.

Username of PAT creator is used as actor for issue added to project

When using GitHub's built-in project automation workflows, a comment shows up in the issue thread indicating that a bot added/removed/etc the issue in the project board.

image

However, when using this action, the username of the person who created the PAT is shown as the actor that added/removed the issue in the project board.

image

That can get confusing as no person manually changed the issue in the project, it was actually the github actions workflow that did it. Is it possible to modify the actor of this action so that a bot is shown rather than the PAT creator?

Could not resolve to a node with the global id of '******'

I have a github workflow using this action that adds all issues with a bug label to my project board. I've configured the workflow in two repos with the same github token available to both (via organization secrets).

In one repo the action is working correctly. In another I am seeing this error:

Could not resolve to a node with the global id of '******'

I've hidden the id value from the error cause I don't know if that's sensitive or not. The id is meaningless to me and looks like some opaque identifier.

Error: Input required and not supplied: github-token

Hi! Can you help me?

I'm having a problem that sometimes I can't get a possible token for github actions and that's why I get this error
(Error: Input required and not supplied: github-token)

This happens when someone opens a pull request from a fork. How can I fix it to always use tokens from source repository?

In the current actions of the pull request, issue is run on open.

I searched the internet for a solution, but I didn't find any great solution because it works anyway, so I guess I need to set something in the actions.

Thanks for the answer in advance.

actions file

name: Add issue or pull request to project board

on:
  issues:
    types:
      - opened
  pull_request:
    types:
      - opened

jobs:
  add-to-project:
    name: Add issue or pull request to project
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v3
      - name: Get event creation date
        id: date
        run: |
          if [[ "${{ github.event_name }}" == "issues" ]]; then
            echo "date=${{ github.event.issue.created_at }}" >> $GITHUB_ENV
          elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
            echo "date=${{ github.event.pull_request.created_at }}" >> $GITHUB_ENV
          fi
      - name: Add to project
        uses: actions/[email protected]
        with:
          project-url: https://github.com/orgs/test/projects/9
          github-token: ${{ secrets.MY_GITHUB_TOKEN }}
        id: add-project
      - name: Update project fields
        uses: titoportas/[email protected]
        with:
          project-url: https://github.com/orgs/test/projects/9
          github-token: ${{ secrets.MY_GITHUB_TOKEN }}
          item-id: ${{ steps.add-project.outputs.itemId }}
          field-keys: Date
          field-values: ${{ env.date }},

Is there a released version?

Hello I'm trying to test some automated workflows. I followed the README, but am seeing an issue:

Error: Unable to resolve action actions/add-to-project@v1, unable to find version v1

I saw that the package.json contains '0.0.0' so I also tried that in place of v1, but then got:

Error: Unable to resolve action actions/[email protected], unable to find version v0.0.0

2 related questions

**To Reproduce**

To Reproduce

Unformatted code:

def main():
    if a:

        # Comment
        def b():
            pass

    if b:
        def c():
            pass

Running black --preview:

def main():
    if a:
        # Comment
        def b():
            pass

    if b:

        def c():
            pass

Expected behavior

Empty line should be consistent added (or removed) between the code block open and inner function:

def main():
    if a:

        # Comment
        def b():
            pass

    if b:

        def c():
            pass

Or,

def main():
    if a:
        # Comment
        def b():
            pass

    if b:
        def c():
            pass

Additional context

I did a bisect and this was caused by psf/black#3035.

Note that if the inner function doesn't have a leading comment, it won't remove the empty line:

def main():
    if a:

        def b():
            pass

        def c():
            pass

Thus I believe this is an undesired behavior change in #3035?

Originally posted by @yilei in psf/black#3300

Add elements from repositories under different org / owner

As noted in the README

NOTE: This Action (currently) only supports auto-adding Issues to a Project which lives in the same organization as your target Repository.

and also raised on the feedback forums (without ack from GH) it is not possible to add issues to a board that belongs to a different org. As this is possible in the UI, it appears to be a validation issue in the GraphQL API.

My question / suggestion is, will this ever become possible? It would be a huge relief in managing multi-org set ups that popular open source ecosystems use, such as Ory.

Thanks! :)

Variable $input of type AddProjectV2ItemByIdInput not provided!

I am trying to automate adding an issues to Projects using GHA

      - name: Add To RSF Programme Management Project
        uses: actions/[email protected]

        with:
          project-url: https://github.com/orgs/aim-rsf/projects/9
          github-token: ${{ secrets.GH_TOKEN }}

I am not sure why it keeps getting this error - I have been trying to debug it for ages, any help is appreciated!

Run actions/[email protected]
##[debug]Issue/PR owner: aim-rsf
##[debug]Project URL: https://github.com/orgs/aim-rsf/projects/9
##[debug]Project owner: aim-rsf
##[debug]Project number: 9
##[debug]Project owner type: orgs
##[debug]Project node ID: PVT_kwDOBlYxfM4AEvO5
##[debug]Content ID: undefined
Creating project item
Error: Request failed due to following response errors:
 - Variable $input of type AddProjectV2ItemByIdInput! was provided invalid value for contentId (Expected value to not be null)

The URL is correct but is it because the project is private?

Question about personal access token

Problem

I'm trying to implement the add-to-project action to an organization's repository. It appears that, in order to do so, a personal access token is required:

# from action.yaml
github-token:
    required: true
    description: A GitHub personal access token with write access to the project

However, I don't fully understand how to store a PAT in an organization's secret variables. Does the "value" field of the secret variable actually need to be a PAT for this action to work? Since organizations aren't able to generate PATs, does one member of the org need to be responsible for generating and maintaining the token?

Cannot read properties of null (reading 'id')

Hello. I'm trying to use this action and receive the following error

image

2022-05-13T07:23:46.6339635Z Requested labels: ubuntu-latest
2022-05-13T07:23:46.6339681Z Job defined at: FlowCrypt/flowcrypt-android/.github/workflows/add-opened-issue-to-project.yml@refs/heads/master
2022-05-13T07:23:46.6339707Z Waiting for a runner to pick up this job...
2022-05-13T07:23:47.2172502Z Job is waiting for a hosted runner to come online.
2022-05-13T07:23:52.4694607Z Job is about to start running on the hosted runner: Hosted Agent (hosted)
2022-05-13T07:23:55.8276512Z Current runner version: '2.291.1'
2022-05-13T07:23:55.8302372Z ##[group]Operating System
2022-05-13T07:23:55.8303003Z Ubuntu
2022-05-13T07:23:55.8303299Z 20.04.4
2022-05-13T07:23:55.8303583Z LTS
2022-05-13T07:23:55.8303857Z ##[endgroup]
2022-05-13T07:23:55.8304229Z ##[group]Virtual Environment
2022-05-13T07:23:55.8304618Z Environment: ubuntu-20.04
2022-05-13T07:23:55.8304968Z Version: 20220508.1
2022-05-13T07:23:55.8305471Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu20/20220508.1/images/linux/Ubuntu2004-Readme.md
2022-05-13T07:23:55.8306152Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20220508.1
2022-05-13T07:23:55.8306655Z ##[endgroup]
2022-05-13T07:23:55.8307026Z ##[group]Virtual Environment Provisioner
2022-05-13T07:23:55.8307358Z 1.0.0.0-main-20220421-1
2022-05-13T07:23:55.8307705Z ##[endgroup]
2022-05-13T07:23:55.8308709Z ##[group]GITHUB_TOKEN Permissions
2022-05-13T07:23:55.8309313Z Actions: write
2022-05-13T07:23:55.8309792Z Checks: write
2022-05-13T07:23:55.8310156Z Contents: write
2022-05-13T07:23:55.8310490Z Deployments: write
2022-05-13T07:23:55.8310841Z Discussions: write
2022-05-13T07:23:55.8311171Z Issues: write
2022-05-13T07:23:55.8311442Z Metadata: read
2022-05-13T07:23:55.8311797Z Packages: write
2022-05-13T07:23:55.8312135Z Pages: write
2022-05-13T07:23:55.8312417Z PullRequests: write
2022-05-13T07:23:55.8312778Z RepositoryProjects: write
2022-05-13T07:23:55.8313172Z SecurityEvents: write
2022-05-13T07:23:55.8313509Z Statuses: write
2022-05-13T07:23:55.8313795Z ##[endgroup]
2022-05-13T07:23:55.8317337Z Secret source: Actions
2022-05-13T07:23:55.8317841Z Prepare workflow directory
2022-05-13T07:23:55.9143414Z Prepare all required actions
2022-05-13T07:23:55.9326135Z Getting action download info
2022-05-13T07:23:56.1417635Z Download action repository 'actions/[email protected]' (SHA:7a0820f97673dfefc999713a9a6d6b7ee128bba5)
2022-05-13T07:23:56.9766461Z ##[group]Run actions/[email protected]
2022-05-13T07:23:56.9766857Z with:
2022-05-13T07:23:56.9767200Z   project-url: https://github.com/orgs/FlowCrypt/projects/1
2022-05-13T07:23:56.9767786Z   github-token: ***
2022-05-13T07:23:56.9768055Z ##[endgroup]
2022-05-13T07:23:57.3977728Z ##[error]Cannot read properties of null (reading 'id')
2022-05-13T07:23:57.4226810Z Cleaning up orphan processes

My configuration
https://raw.githubusercontent.com/FlowCrypt/flowcrypt-android/master/.github/workflows/add-opened-issue-to-project.yml

name: Add an opened issue to the project
# https://github.com/marketplace/actions/add-to-github-projects-beta
on:
  issues:
    types:
      - opened

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          project-url: https://github.com/orgs/FlowCrypt/projects/1
          github-token: ${{ secrets.FLOWCRYPT_ROBOT_ACCESS_TOKEN }}

Maybe somebody knows what is wrong

Add Support for Assign and Unassign Event Types

Thank you so much for this action, it saves our team a lot of time needing to add issues to our issues board manually.

Could you consider adding assigned and unassigned as supported action event types? We like to automatically update the status on issues if it has been assigned or unassigned. For example, if an issue is opened by our Support team without an owner assigned, and then engineer X assigns themself as the owner, we like to automatically move that issue to "In Progress". Reversely, if they remove themself from being owner such that there are no owners, we would move it back to being "Open".

fdghdfgh

Thank you πŸ™‡β€β™€ for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.

If your issue is relevant to this repository, please delete this text and continue to create this issue. Thank you in advance.

dependabot labeled PRs do not add to project

I created a action:

name: Add PRs to Dependabot PRs dashboard

on:
  pull_request:
    types:
      - labeled

jobs:
  add-to-project:
    name: Add PR to dashboard
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          project-url: https://github.com/orgs/...
          github-token: ${{ secrets.ADMIN_BACKLOG }}
          labeled: dependencies

This action works to add the PR to the project if I manually add the dependencies label.
But, the dependabot created PRs (the Bump PRs) do not automatically add to the project.

Lack of token permission should state all scope requirements in error message, instead of causing multiple adjustment roundtrips

Hello there, and thanks for this very helpful action!

I just had my "add newly created issues and PRs to a project" workflow fail that's based on actions/add-to-project@main:

Request failed due to following response errors:
 - Your token has not been granted the required scopes to execute this query. The 'projectV2' field requires one of the following scopes: ['read:project'], but your token has only been granted the: ['repo', 'write:org'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.
 - Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:project'], but your token has only been granted the: ['repo', 'write:org'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.

Ok, easy enough, I guess with the latest changes to the whole projects API some things changed, no prob, dutifully obliged. Added read:project as instructed, reran the failed action. Which then failed again with:

Request failed due to following response errors:
 - Your token has not been granted the required scopes to execute this query. The 'addProjectV2ItemById' field requires one of the following scopes: ['project'], but your token has only been granted the: ['read:project', 'repo', 'write:org'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.

Doing that as well, then rerunning, and things are finally green again.

However, it raises the question, is there any way to maybe ask for all required scopes right away to guarantee an error free operation, instead of sending me on multiple errands and also briefly making me doubt my sanity? πŸ˜…

Tests are not run in CI on push

When changes are pushed, the tests are not executed in GitHub Actions.

The test.yml workflow only runs npm run build, which checks formatting and linting and ensures that the code can be compiled, but doesn't actually run the Jest tests with npm run test.

main/v0.5.0: Could not resolve to a ProjectV2 with the number

Apparently this action does not work and gives and error about failure to find the project.

Could not resolve to a ProjectV2 with the number

I tried to use both latest release @v0.5.0 and @main but the result was the same.

I know that the token is good because it used in another action that is called before this one.

https://github.com/ansible/devtools/actions/runs/6121911508/job/16616619759?pr=132

I might be missing something but I also know that https://github.com/orgs/ansible/projects/86 is a valid project too.

The workflow source is at https://github.com/ansible/devtools/blob/main/.github/workflows/ack.yml#L52-L58

New enhancement to add tags upon execution

The current code is a filter to only add the issue to the project when those labels are detected.

          labeled: bug, needs-triage
          label-operator: OR

I would like to see a feature where you can have the task add new tags with whatever label(s) you desire upon execution. For instance, something like add-label:

on:
  issues:
    types:
      - opened

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@main
        with:
          project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
          github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
          add-label: needs-triage

Add support for arbitrary issues created during a workflow

I'm looking for an action that can add an arbitrary issue to a project. For my use-case, I'm creating an issue during a workflow job execution, and after the issue is created I want to assign it to a project board. However, to do that the action needs to take the issue-id as an input.

Could this be a feature for this action?

Error `Mapping Token` when using Github workflows reusable

Hi all, I'm trying to create a reusable workflow from GitHub actions using actions/add-to-project. The problem is that it returns an error when parsing secrets A mapping was not expected Unexpected type 'MappingToken' encountered while reading 'input value'. The 'StringToken' type was expected.
This is my code:

Reusable flow:

name: "Adiciona Issues em Projects GitHub"

on:
  workflow_call:
    inputs:
      project_url:
        description: "URL do projetcs github"
        required: true
        type: string
    secrets:
      token:
        description: "Personal token para leitura/escrita projects github"
        required: true

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@main
        with:
          project-url: {{ inputs.project_url }}
          github-token: ${{ secrets.token }}

Reusable actions call:

name: "Adiciona Issues em Projects GitHub"
  
on:
  issues:
    types:
      - opened

jobs:
  add-issue:
    uses: "EzzioMoreira/lab-actions/.github/workflows/add-projects.yaml@master"
    with:
      project_url: https://github.com/users/EzzioMoreira/projects/2
    secrets:
      token: ${{ secrets.API_TOKEN_GITHUB }}

I tried using another realize tag but always returned the error The 'StringToken' type was expected.
I think that my code is correct.
Has anyone else reported any problem?

Possible to use secrets.GITHUB_TOKEN?

Hi there, I was wondering if it is possible to use the automated secrets.GITHUB_TOKEN instead of a PAT? I do not see any reference to it in the docs, so I assume not, but wanted to confirm.

Thank you!

Workflow not running on PRs labeled by other GHA

Summary

The add-to-project workflow is not running when a PR is labeled by another Github Action.

Reproduction steps

  1. Configure https://github.com/actions/add-to-project to automatically add Pull Request with label foo to a project
  2. Configure a GHA such as https://github.com/actions/labeler to automatically label Pull Requests with foo
  3. Open a pull request
  4. PR will automatically be labeled with foo
  5. PR will not be added to project board

Sample config:

name: Sample config

on:
  pull_request:
    types:
      - labeled

jobs:
  add-to-project:
    name: Add PR to project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@main
        with:
          project-url: https://github.com/orgs/example/projects/123/views/1
          github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
          labeled: foo

"The priority you are attempting to set for this record is not unique"

Hi, thanks for the great work!

I am setting up a GitHub Project [beta] to track incidents at my company. My flow is : [incident management SaaS] -> GitHub integration to create an issue -> actions/add-to-project to add it to the project.

I just set it up and tested it by creating 15 issues in short succession using the GitHub CLI. They all got added to the project, but one action failed with the following output:

Error: Request failed due to following response errors:
 - Prioritization The priority you are attempting to set for this record is not unique

How can I fix this? Luckily it's rare (1/15), and maybe it only happens when I create many issues at the same time.

Thanks!

My full config is here:

name: "Add incident issues to tracker"
on:
  issues:
    types: [opened]

jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/add-to-project@main
      if: ${{ github.event_name == 'issues' && contains(github.event.issue.body, 'incident-review') }}
      with:
        project-url: https://github.com/orgs/cadedaniel-org/projects/1/
        github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}

Failing tests on the `main` branch

There are currently two failing tests on the main branch - at least on my machine.

The output is below:

> @actions/[email protected] test
> jest

 FAIL  __tests__/add-to-project.test.ts
  addToProject
    βœ“ adds an issue to the project (2 ms)
    βœ“ adds matching issues with a label filter without label-operator
    βœ“ adds matching pull-requests with a label filter without label-operator
    βœ“ does not add un-matching issues with a label filter without label-operator (1 ms)
    βœ“ adds matching issues with labels filter with AND label-operator
    βœ“ does not add un-matching issues with labels filter with AND label-operator
    βœ“ does not add matching issues with labels filter with NOT label-operator
    βœ• adds issues that do not have labels present in the label list with NOT label-operator (1 ms)
    βœ“ adds matching issues with multiple label filters
    βœ“ does not add un-matching issues with multiple label filters
    βœ“ handles spaces and extra commas gracefully in label filter input
    βœ“ throws an error when url isn't a valid project url (5 ms)
    βœ“ throws an error when url isn't under the github.com domain (1 ms)
    βœ“ constructs the correct graphQL query given an organization owner
    βœ“ constructs the correct graphQL query given a user owner
    βœ• compares labels case-insensitively
  mustGetOwnerTypeQuery
    βœ“ returns organization for orgs ownerType
    βœ“ returns user for users ownerType
    βœ“ throws an error when an unsupported ownerType is set (1 ms)

  ● addToProject β€Ί adds issues that do not have labels present in the label list with NOT label-operator

    TypeError: Cannot read properties of undefined (reading 'id')

       96 |   )
       97 |
    >  98 |   const projectId = idResp[ownerTypeQuery]?.projectV2.id
          |                                                       ^
       99 |   const contentId = issue?.node_id
      100 |
      101 |   core.debug(`Project node ID: ${projectId}`)

      at src/add-to-project.ts:98:55
      at fulfilled (src/add-to-project.ts:28:58)

  ● addToProject β€Ί compares labels case-insensitively

    TypeError: Cannot read properties of undefined (reading 'id')

       96 |   )
       97 |
    >  98 |   const projectId = idResp[ownerTypeQuery]?.projectV2.id
          |                                                       ^
       99 |   const contentId = issue?.node_id
      100 |
      101 |   core.debug(`Project node ID: ${projectId}`)

      at src/add-to-project.ts:98:55
      at fulfilled (src/add-to-project.ts:28:58)

Test Suites: 1 failed, 1 total
Tests:       2 failed, 17 passed, 19 total
Snapshots:   0 total
Time:        1.218 s, estimated 2 s
Ran all test suites.

New Release?

The README specifically says that v0.5.0 uses a deprecated API, but that's also the last release.

Should there have been a new release cut or should we use the deprecated API?

Set project board fields

I would like to be able to set status and other custom fields to issues added to a project

For example, if I'd like to set a Status = Triage and Stack = nodejs

jobs:
  add-to-project:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          project-url: https://github.com/orgs/zazuko/projects/23
          github-token: ${{ secrets.BACKLOG_PAT }}
          set:
+           Status: Triage
+           Stack: nodejs

Error `Mapping Token` when using Github workflows reusable

Hi all, I'm trying to create a reusable workflow from GitHub actions using actions/add-to-project. The problem is that it returns an error when parsing secrets A mapping was not expected Unexpected type 'MappingToken' encountered while reading 'input value'. The 'StringToken' type was expected.
This is my code:

Reusable flow:

name: "Adiciona Issues em Projects GitHub"

on:
  workflow_call:
    inputs:
      project_url:
        description: "URL do projetcs github"
        required: true
        type: string
    secrets:
      token:
        description: "Personal token para leitura/escrita projects github"
        required: true

jobs:
  add-to-project:
    name: Add issue to project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@main
        with:
          project-url: {{ inputs.project_url }}
          github-token: ${{ secrets.token }}

Reusable actions call:

name: "Adiciona Issues em Projects GitHub"
  
on:
  issues:
    types:
      - opened

jobs:
  add-issue:
    uses: "EzzioMoreira/lab-actions/.github/workflows/add-projects.yaml@master"
    with:
      project_url: https://github.com/users/EzzioMoreira/projects/2
    secrets:
      token: ${{ secrets.API_TOKEN_GITHUB }}

I tried using another realize tag but always returned the error The 'StringToken' type was expected.
I think that my code is correct.
Has anyone else reported any problem?

Bad Credentials error when run in organization using service account

I'm able to run the add-to-project GitHub Action workflow without any issue in a personal repo, and feeling pleased with it, tried to implement it for my organization. Unfortunately, I haven't been able to make it work: I keep getting a "Bad Credentials" error message.

After pushing the add-to-project.yml to the repo, I used a service account with organization 'member' privileges to create a PAT (ensuring it had the same secret name indicated in the .yml file), giving it the 'repo', 'project', and 'workflow' scopes.
I then added this service account to the repo as a collaborator with owner/admin rights.
Next, I added a repository secret (named the same secret name indicated in the .yml file) to the repo.
Testing at this point resulted in a "Bad Credentials" error.

After conducting research, added the following scopes to the token:

  • write:org
  • read:org

Testing of this change did not work. More research found that some people had to added these additional scopes:

  • manage_runners:org
  • manage_runners:enterprise

Testing of this scope update still did not work, so I conducted more troubleshooting with the following attempts:

  • Creating the PAT from my personal account which has full owner/admin access of the entire org (set as owner/admin to repo)
  • Creating the PAT from a different service account which has full owner/admin access of the entire org (set as owner/admin to repo)
  • Updating the PAT to have full scope rather than limited to just 'repo', 'project', and 'workflow'
  • Create environment secret instead of repo secret (done with service account 1 and service account 2)
  • Create org secret instead of repo secret (done with service account 1 and service account 2)

Each test run resulted in the same "Bad Credentials" error. Not sure if I hit a bug, or if implementation for an org is different.

Action does not work on PRs from forks

As a large open source organization, we follow GitHub's best practices to have two orgs:

  1. An open source org github.com/ory
  2. An enterprise org github.com/ory-corp

This allows us to invite unlimited collaborators to the open source projects, while staying compliant in all aspects of closed source development.

When users create PRs against our open source ecosystem, this usually happens on forks. The problem is that the GitHub Secret containing the personal access token that this action needs, is not available on forked repositories.

This leads the action to fail to run when a PR from a fork is added:

https://github.com/ory/kratos/runs/7496471335?check_suite_focus=true

Since we use the boards to also manage open source reviews as part of the product development activities, it would be awesome if PRs from forks could also somehow be added to the board.

To solve this, this action could also support a cron-style job which synchronizes all PRs and all issues to the board. This would allow us to sync "missed" PRs from forks because the cron job runs in the root org and has access to the secret.

Workflow fails if issue is already added to project

The workflow fails if the issue is already added to the project with:
Content already exists in this project

It would be good if the workflow allows to skip (or atleast not fail) in case issue alreadt exists in the project, for the following scenarios:

  • Issue was created from draft directly from the project board, thus the action ran after it was already added to the project
  • Issue was re-opened, but was already a part of the project
  • Issue was already part of the project, but the specified label was added.

Outputs are not documented in the action manifest

It seems like the action is setting an itemId output, but it's not documented in the action manifets: adding it would make it easier for IDEs to check and autocomplete output names, and for users to know that it exists ;)

Could not resolve to a ProjectV2 with the number 3.

Im currently getting this error.

Error: Request failed due to following response errors:
 - Could not resolve to a ProjectV2 with the number 3.

My workflow looks like:

jobs:
   add-to-project:
       name: Add issue to project
       runs-on: ubuntu-latest
       steps:
           - uses: actions/[email protected]
             with:
                 project-url: https://github.com/orgs/{org}/projects/3
                 github-token: ${{ secrets.MY_SECRET }}
  • The Project link is valid and the secret too.

Ability to filter with label wildcards?

We use a hierarchical labelling system where I am. For example, origin/customer/{name-of-customer}, area/product/widget-factory/windows.

I'd really like to have closer control over how to route issues, so that I could, for example, do label: area/product/* and add that to the product-manager triage project, vs area/internal/foo to a different project.

We have quite deep hierarchies; being able to use glob semantics (? for wildcard single character; * for wildcard between /, and; ** for recursively wildcard) would be extremely useful.

Is that something you would support, either by implementing directly, or by accepting an appropriate-quality-standards PR?

PR not being added to project when created

Description:

I have created 2 new workflows for my repository. The intent is for both of them use this GitHub action to automatically add the issue or PR to my organizational project when the issue or PR is created.
The add issue workflow works just fine.
The add PR workflow does not trigger even though I have the correct trigger for the workflow setup.

Expected Behavior:

The workflow automatically triggers when creating a new PR.

Workflows Being Used:

βœ…This workflow is for adding issues and works fine.

name: βš™οΈAdd Issue To Org Project


on:
  workflow_dispatch:
  issues:
    types: 
      - opened


jobs:
  testing:
    name: testing
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
      with:
        project-url: https://github.com/orgs/KinsonDigital/projects/11
        github-token: ${{ secrets.CICD_TOKEN }}
        label-operator: NOT

❌This workflow is for adding pull requests and DOES NOT work.

name: βš™οΈAdd PR To Org Project


on:
  workflow_dispatch:
  pull_request:
    types: 
      - opened


jobs:
  testing:
    name: testing
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
      with:
        project-url: https://github.com/orgs/KinsonDigital/projects/11
        github-token: ${{ secrets.CICD_TOKEN }}
        label-operator: NOT

The `set-output` command is deprecated and will be disabled soon.

This warning was fixed in #231. It is not present in the latest release which is v0.3.0.

Screenshot 2022-11-09 at 4 00 37 PM

https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Starting 1st June 2023 workflows using save-state or set-output commands via stdout will fail with an error.

Would we consider a version bump due to the importance of said change?

Alternatively for those looking for a quick way out: uses: actions/add-to-project@51e172a520b4925f1909cbd44f0e991607db88a9

Authentication via GitHub Apps

I'm trying to set up automation for an organization project. Following this guidance, I would need to use a GitHub App for an organization project. Currently, this action's configuration requires a personal access token but I don't believe that will provide access to an organization project. Therefore, I'm requesting the capability of authenticating via a GitHub App.

Please let me know if I have any misunderstandings. Thanks!

Question: Feature to Support GitHub domains other than github.com

Hello!

project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
Any plans to support domain names other than github.com?

For example, if an enterprise GitHub repository (i.e. github.company.name.net) wanted to use this feature, would that be possible?

Thank you.

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.