Skip to content
play

GitHub Action

Sync Issue Field

v0.1.2 Latest version

Sync Issue Field

play

Sync Issue Field

Sync GitHub parent issue's fields to child issue's fields

Installation

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

              

- name: Sync Issue Field

uses: kudoas/sync-issue-field@v0.1.2

Learn more about this action in kudoas/sync-issue-field

Choose a version

Sync Issue Field

This action automatically synchronizes child and parent issue field. If you create child issue from parent issue, the parent field is copied to the child.

Usage

with:
  # Repository name with owner. For example, kudoas/sync-issue-field
  # Default: ${{ github.repository }}
  repository: ""

  # The number that identifies the issue. Specify the child issue you wish to synchronize with the parent issue
  # Default: ${{ github.event.issue.number }}
  issue: ""

  # GitHub token used to fetch issue info from the repository.
  # If you want to get an Item from user Projects (not classic), please issue Personal Access Token (PAT).
  # refs. https://github.com/orgs/community/discussions/46681#discussioncomment-8774842
  token: ""

Example Workflow

Create a workflow and save it as a .yml file in the .github/workflows/ directory of your target repository.

name: Sync issue field
on:
  issues:
    types: [opened]

# If use GITHUB_TOKEN, this permission is required.
permissions:
  issues: write
  repository-projects: write # use for sync classic project

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Sync issue field
        uses: kudoas/sync-issue-field@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Contribution

Requirement

  • Go version 1.21

Setup

get source code

git clone git@github.com:kudoas/gis.git
cd /path/to/repository

copy .env from .env.sample

cp .env.sample .env

Get values from GitHub and enter them in .env

INPUT_TOKEN=<YOUR GITHUB TOKEN>
INPUT_REPOSITORY=<TARGET REPOSITORY NAME eg. <owner>/<repository>>
INPUT_ISSUE=<TARGET CHILD ISSUE NUMBER>