Matthew Costabile 7279692a52 Merge pull request #53 from actions/dependabot/npm_and_yarn/typescript-4.6.3
Bump typescript from 4.5.5 to 4.6.3
2022-03-29 11:05:46 -04:00
2022-03-25 22:31:59 +00:00
2022-03-29 13:16:16 +00:00
2022-03-23 11:21:12 -04:00
2022-03-29 15:03:32 +00:00
2022-01-31 14:09:42 -05:00
2022-01-31 15:40:59 -05:00
2022-03-23 11:21:12 -04:00
2022-01-31 14:09:42 -05:00
2022-03-23 11:21:12 -04:00
2022-01-31 14:09:42 -05:00
2022-03-29 17:00:35 +02:00
2022-01-31 15:38:31 -05:00
2022-01-31 14:09:42 -05:00
2022-01-31 15:38:31 -05:00

actions/add-to-project

Use this action to automatically add the current issue or pull request to a GitHub Project. Note that this is for GitHub Projects (beta), not the original GitHub Projects.

Current Status

build-test

🚨 This action is a work-in-progress. Please do not use it except for experimentation until a release has been prepared. 🚨

Usage

See action.yml for metadata that defines the inputs, outputs, and runs configuration for this action.

For more information about workflows, see Using workflows.

To use the action, create a workflow that runs when issues are opened in your repository. Run this action in a step, optionally configuring any filters you may want to add, such as only adding issues with certain labels. If you want to match all the labels, add label-operator input to be AND.

name: Add bugs to bugs project

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 }}
          labeled: bug, new
          label-operator: AND

Further reading and additional resources

Inputs

  • project-url (required) is the URL of the GitHub Project to add issues to.
    eg: https://github.com/orgs|users/<ownerName>/projects/<projectNumber>
  • github-token (required) is a personal access token with the repo, write:org and read:org scopes.
    See Creating a PAT and adding it to your repository for more details
  • labeled (optional) is a comma-separated list of labels used to filter applicable issues. When this key is provided, an issue must have one of the labels in the list to be added to the project. Omitting this key means that any issue will be added.
  • label-operator (optional) is the behavior of the labels filter, either AND or OR that controls if the issue should be matched with all labeled input or any of them, default is OR.

Supported Events

Currently this action supports the following issues events:

  • opened
  • transferred
  • labeled

and the following pull_request events:

  • opened
  • labeled

Using these events ensure that a given issue or pull request, in the workflow's repo, is added to the specified project. If labeled input(s) are defined, then issues will only be added if they contain at least one of the labels in the list.

How to point the action to a specific branch or commit sha

Pointing to a branch name generally isn't the safest way to refer to an action, but this is how you can use this action now before we've begun creating releases.

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 }}

Another option would be to point to a full commit SHA:

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

Creating a PAT and adding it to your repository

Development

To get started contributing to this project, clone it and install dependencies. Note that this action runs in Node.js 16.x, so we recommend using that version of Node (see "engines" in this action's package.json for details).

> git clone https://github.com/actions/add-to-project
> cd add-to-project
> npm install

Or, use GitHub Codespaces.

See the toolkit documentation for the various packages used in building this action.

Publish to a distribution branch

Actions are run from GitHub repositories, so we check in the packaged action in the "dist/" directory.

> npm run build
> git add lib dist
> git commit -a -m "Build and package"
> git push origin releases/v1

Now, a release can be created from the branch containing the built action.

License

The scripts and documentation in this project are released under the MIT License

Description
Automate adding issues and pull requests to GitHub projects
Readme MIT 12 MiB
Languages
TypeScript 83.3%
JavaScript 16.7%