Skip to main content

Moving assigned issues on プロジェクト (クラシック)

You can use GitHub Actions to automatically move an issue to a specific column on a プロジェクト (クラシック) when the issue is assigned.

メモ

  • 新しいプロジェクト エクスペリエンスである Projects が利用できるようになりました。 Projects の詳細については、「Projects について」を参照してください。
  • 新しいプロジェクト (クラシック)は、既に 1 つ以上のプロジェクト (クラシック)を持つ organization、リポジトリ、またはユーザーに対してのみ作成できます。 プロジェクト (クラシック)を作成できない場合は、代わりにプロジェクトを作成します。

メモ

GitHub ホステッド ランナーは、現在 GitHub Enterprise Server ではサポートされていません。 GitHub public roadmap で、今後の計画的なサポートの詳細を確認できます。

Introduction

This tutorial demonstrates how to use the alex-page/github-project-automation-plus action to automatically move an issue to a specific column on a プロジェクト (クラシック) when the issue is assigned. For example, when an issue is assigned, you can move it into the In Progress column your プロジェクト (クラシック).

In the tutorial, you will first make a workflow file that uses the alex-page/github-project-automation-plus action. Then, you will customize the workflow to suit your needs.

Creating the workflow

  1. このプロジェクト管理ワークフローを適用したいリポジトリを選択してください。 書き込みアクセス権を持つ既存のリポジトリを利用することも、新しいリポジトリを作成することもできます。 リポジトリの作成について詳しくは、「新しいリポジトリの作成」をご覧ください。

  2. In your repository, choose a プロジェクト (クラシック). You can use an existing project, or you can create a new project. For more information about creating a project, see project (classic) の作成.

  3. リポジトリに .github/workflows/YOUR_WORKFLOW.yml というファイルを作成します (YOUR_WORKFLOW は任意の名前に置き換えます)。 これがワークフローファイルです。 GitHub での新しいファイルの作成について詳しくは、「新しいファイルの作成」をご覧ください。

  4. Copy the following YAML contents into your workflow file.

    YAML
    # このワークフローはGitHubによって認定されていないアクションを使用します。
    # それらはサードパーティによって提供され、
    # 別個の利用規約、プライバシーポリシー、
    # ドキュメントを参照してください。
    
    # GitHub では、コミット SHA にアクションをピン留めすることが推奨されます。
    # 新しいバージョンを取得するには、SHA を更新する必要があります。
    # タグまたはブランチを参照することもできますが、アクションは警告なしに変更される可能性があります。
    
    name: Move assigned card
    on:
      issues:
        types:
          - assigned
    jobs:
      move-assigned-card:
        runs-on: ubuntu-latest
        steps:
          - uses: alex-page/github-project-automation-plus@7ffb872c64bd809d23563a130a0a97d01dfa8f43
            with:
              project: Docs Work
              column: In Progress
              repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
    
  5. Customize the parameters in your workflow file:

    • Change the value for project to the name of your プロジェクト (クラシック). If you have multiple プロジェクト (クラシック) with the same name, the alex-page/github-project-automation-plus action will act on all projects with the specified name.
    • Change the value for column to the name of the column where you want issues to move when they are assigned.
    • Change the value for repo-token:
      1. Create a personal access token (classic) with the repo scope. For more information, see 個人用アクセス トークンを管理する.
      2. Store this personal access token as a secret in your repository. For more information about storing secrets, see Using secrets in GitHub Actions.
      3. In your workflow file, replace PERSONAL_ACCESS_TOKEN with the name of your secret.
  6. ワークフローファイルを、リポジトリのデフォルトブランチにコミットしてください。 詳しくは、「新しいファイルの作成」をご覧ください。

Testing the workflow

Whenever an issue in your repository is assigned, the issue will be moved to the specified プロジェクト (クラシック) column. If the issue is not already on the プロジェクト (クラシック), it will be added to the プロジェクト (クラシック).

If your repository is user-owned, the alex-page/github-project-automation-plus action will act on all projects in your repository or personal account that have the specified project name and column. Likewise, if your repository is organization-owned, the action will act on all projects in your repository or organization that have the specified project name and column.

Test your workflow by assigning an issue in your repository.

  1. Open an issue in your repository. For more information, see Issue の作成.
  2. Assign the issue. For more information, see GitHub の他のユーザに Issue およびプルリクエストをアサインする.
  3. To see the workflow run that assigning the issue triggered, view the history of your workflow runs. For more information, see Viewing workflow run history.
  4. When the workflow completes, the issue that you assigned should be added to the specified プロジェクト (クラシック) column.

Next steps