From 3e3f8b5f8f0e321e299649baa9383d410af543c7 Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Thu, 24 Mar 2022 05:04:43 +0000 Subject: [PATCH 1/9] github/memex#8948: Some restructuring, current status and license --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0a7f0f7..22662c2 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,19 @@ # actions/add-to-project -🚨 **This action is a work in progress. Please do not use it except for -experimentation until a release has been prepared.** 🚨 - Use this action to automatically add issues to a GitHub Project. Note that this is for [GitHub Projects (beta)](https://docs.github.com/en/issues/trying-out-the-new-projects-experience/about-projects), not the original GitHub Projects. +## Current Status + +![Build status](https://github.com/github/add-to-project/workflows/test/badge.svg) + +🚨 **This action is a work-in-progress. Please do not use it except for +experimentation until a release has been prepared.** 🚨 + +## Usage + 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. @@ -76,3 +82,7 @@ the "dist/" directory. ``` 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](LICENSE) From 3cc9b29b076f6013768c2ddf1c3f1e587621d0ee Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Thu, 24 Mar 2022 06:18:57 +0000 Subject: [PATCH 2/9] github/memex#8948: Adding docs for supported events, creating PATs and commit SHAs --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 22662c2..147cfda 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ experimentation until a release has been prepared.** 🚨 ## Usage +_See [action.yml](action.yml) for [metadata](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions) that defines the inputs, outputs, and runs configuration for this action._ + +_For more information about workflows, see [Using workflows](https://docs.github.com/en/actions/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. @@ -31,9 +35,6 @@ jobs: name: Add issue to project runs-on: ubuntu-latest steps: - # 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. - # Another option would be to point to a full commit SHA. - uses: actions/add-to-project@main with: project-url: https://github.com/orgs//projects/ @@ -43,14 +44,64 @@ jobs: ## Inputs -- `project-url` is the URL of the GitHub Project to add issues to. -- `github-token` is a [personal access +- `project-url` _(required)_ is the URL of the GitHub Project to add issues to. +- `github-token` _(required)_ is a [personal access token](https://github.com/settings/tokens/new) with the `repo`, `write:org` and `read:org` scopes. -- `labeled` is a comma-separated list of labels. For an issue to be added to the + _See [Creating a PAT and adding it to your repository](creating-a-pat-and-adding-it-to-your-repository) for more details_ +- `labeled` _(optional)_ is a comma-separated list of labels. For an issue to be added to the project, it must have _one_ of the labels in the list. Omitting this key means that all issues will be added. +## Supported Events + +Currently this action supports the following [issue events](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues): + +- `opened` +- `transferred` + +This ensures that all issues in the workflow's repo are added to the [specified project](#project-url). If [labeled input(s)](#labeled) 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. + +```yaml +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//projects/ + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} +``` + +Another option would be to point to a full [commit SHA](https://docs.github.com/en/get-started/quickstart/github-glossary#commit): + +```yaml +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@ + with: + project-url: https://github.com/orgs//projects/ + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} +``` + +## Creating a PAT and adding it to your repository + +- create a new [personal access + token](https://github.com/settings/tokens/new) with `repo`, `write:org` and + `read:org` scopes + _see [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)_ + +- add the newly created PAT as a repository secret, this secret will be referenced by the [github-token input](#github-token) + _see [Encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository)_ + ## Development To get started contributing to this project, clone it and install dependencies. From c6f7b220dbfbe3642766031406f5cc6e33f3856d Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Thu, 24 Mar 2022 21:01:25 +0000 Subject: [PATCH 3/9] github/memex#8948: Updates badge url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 147cfda..de888d0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ not the original GitHub Projects. ## Current Status -![Build status](https://github.com/github/add-to-project/workflows/test/badge.svg) +![Build status](https://github.com/actions/add-to-project/workflows/test/badge.svg) 🚨 **This action is a work-in-progress. Please do not use it except for experimentation until a release has been prepared.** 🚨 From 19cb14e026bfe08ddad9a1fb93b9fedda876e77a Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Thu, 24 Mar 2022 21:06:12 +0000 Subject: [PATCH 4/9] github/memex#8948: Minor adjustments --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de888d0..198162d 100644 --- a/README.md +++ b/README.md @@ -97,10 +97,10 @@ jobs: - create a new [personal access token](https://github.com/settings/tokens/new) with `repo`, `write:org` and `read:org` scopes - _see [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)_ + _see [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information_ - add the newly created PAT as a repository secret, this secret will be referenced by the [github-token input](#github-token) - _see [Encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository)_ + _see [Encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for more information_ ## Development From d8cf04bb66e8025fcec3a5b9056910c9b89d54cf Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Thu, 24 Mar 2022 21:12:55 +0000 Subject: [PATCH 5/9] Clarify the intention of the labeled input Co-authored-by: Katarina Blagojevic --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 198162d..bc3c1e0 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,7 @@ jobs: token](https://github.com/settings/tokens/new) with the `repo`, `write:org` and `read:org` scopes. _See [Creating a PAT and adding it to your repository](creating-a-pat-and-adding-it-to-your-repository) for more details_ -- `labeled` _(optional)_ is a comma-separated list of labels. For an issue to be added to the - project, it must have _one_ of the labels in the list. Omitting this key means - that all issues will be added. +- `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. ## Supported Events From 4d561a46b374793f0eb2bd379d234015c9cc77fb Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Thu, 24 Mar 2022 21:20:02 +0000 Subject: [PATCH 6/9] github/memex#8948: Regen badge from workflow UI --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc3c1e0..1410119 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ not the original GitHub Projects. ## Current Status -![Build status](https://github.com/actions/add-to-project/workflows/test/badge.svg) +[![build-test](https://github.com/actions/add-to-project/actions/workflows/test.yml/badge.svg)](https://github.com/actions/add-to-project/actions/workflows/test.yml) 🚨 **This action is a work-in-progress. Please do not use it except for experimentation until a release has been prepared.** 🚨 From 4a5df49dfeb180106a2de4b30e0b4a26755340f4 Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Thu, 24 Mar 2022 22:06:12 +0000 Subject: [PATCH 7/9] github/memex#8948: Formatting and index --- README.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1410119..766d19d 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,23 @@ jobs: labeled: bug ``` +#### Further reading and additional resources + +- [Inputs](#inputs) +- [Supported Events](#supported-events) +- [How to point the action to a specific branch or commit sha](#how-to-point-the-action-to-a-specific-branch-or-commit-sha) +- [Creating a PAT and adding it to your repository](creating-a-pat-and-adding-it-to-your-repository) +- [Development](#development) +- [Publish to a distribution branch](#publish-to-a-distribution-branch) + ## Inputs -- `project-url` _(required)_ is the URL of the GitHub Project to add issues to. -- `github-token` _(required)_ is a [personal access +- `project-url` **(required)** is the URL of the GitHub Project to add issues to. +- `github-token` **(required)** is a [personal access token](https://github.com/settings/tokens/new) with the `repo`, `write:org` and - `read:org` scopes. + `read:org` scopes. _See [Creating a PAT and adding it to your repository](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. +- `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. ## Supported Events @@ -94,11 +103,11 @@ jobs: - create a new [personal access token](https://github.com/settings/tokens/new) with `repo`, `write:org` and - `read:org` scopes - _see [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information_ + `read:org` scopes + _See [Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) for more information_ -- add the newly created PAT as a repository secret, this secret will be referenced by the [github-token input](#github-token) - _see [Encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for more information_ +- add the newly created PAT as a repository secret, this secret will be referenced by the [github-token input](#github-token) + _See [Encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for more information_ ## Development From d3bdc22ebd6edb2b8b328adad8059320083f88e1 Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Fri, 25 Mar 2022 00:14:19 +0000 Subject: [PATCH 8/9] github/memex#8949: Adds example project url --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 766d19d..abc7bf5 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,8 @@ jobs: ## Inputs -- `project-url` **(required)** is the URL of the GitHub Project to add issues to. +- `project-url` **(required)** is the URL of the GitHub Project to add issues to. + _eg: `https://github.com/orgs|users//projects/`_ - `github-token` **(required)** is a [personal access token](https://github.com/settings/tokens/new) with the `repo`, `write:org` and `read:org` scopes. From 106684e914827847d787b59d8a6228a23840cae4 Mon Sep 17 00:00:00 2001 From: Shaun Kirk Wong Date: Fri, 25 Mar 2022 11:17:26 -0700 Subject: [PATCH 9/9] Adds `labeled` as a supported event --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index abc7bf5..bf21818 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ Currently this action supports the following [issue events](https://docs.github. - `opened` - `transferred` +- `labeled` This ensures that all issues in the workflow's repo are added to the [specified project](#project-url). If [labeled input(s)](#labeled) are defined, then issues will only be added if they contain at least _one_ of the labels in the list.