Skip to content

Synchronizes child and parent GitHub Issue field

License

Notifications You must be signed in to change notification settings

kudoas/sync-issue-field

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

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>