Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

copy-issue-labels

v1.1

copy-issue-labels

play

copy-issue-labels

Copy labels from linkend issues

Installation

Copy and paste the following snippet into your .yml file.

              

- name: copy-issue-labels

uses: michalvankodev/[email protected]

Learn more about this action in michalvankodev/copy-issue-labels

Choose a version

copy-issue-labels github action

Motivation for creating this action was to copy labels from linked issues to the issue / PR which triggered workflow.

Example workflow

This workflow will copy labels from the linked issue for the opened PR.

Github issues can link other issues and this linking is done automatically whenever PR mentions one of the keywords for automated workflows. See documentation

on: 
  pull_request:
    types: [opened]

jobs:
  copy-labels:
    runs-on: ubuntu-latest
    name: Copy labels from linked issues
    steps:
      - name: copy-labels
        uses: michalvankodev/copy-issue-labels@v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}

There is also support for different workflows to trigger sync of the labels with issue-number parameter

    steps:
      - name: copy-labels
        uses: michalvankodev/[email protected]
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          issue-number: ${{ github.event.inputs.issue }}

Because GitHub API doesn't provide information about linked issues this workflow will parse the information from the body of the issue.

Custom keywords

You can provide custom keywords which will be picked up by the parser.

These keywords will not override github specified keywords.

steps:
  - name: copy-labels
    uses: michalvankodev/copy-issue-labels@v1
    with:
      repo-token: ${{ secrets.GITHUB_TOKEN }}
      custom-keywords: |
        solves
        references