Skip to content

GitHub workflow to transfer issues automatically when using certain labels like "Security Risk", "Spam" or the label you chose.

License

Notifications You must be signed in to change notification settings

Astorcamon/Transfer_Issues_by_Label_Workflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Downloads License Latest Release Release Date

Languages Top Language Repo Size Visits

Table of Contents




Project Description

This workflow (action) for GitHub allows you automatically transfer issues to another repository when you applies a label previously defined.

  • ✅ You can use this to move issues that are a security risk to a private repository. (See => 💡)
  • ✅ You also can select multiple issues and assign the label "move", to transfer several issues to another repository.
  • ✅ You can use it to move spam to a separate repository. (See => 💡)
  • ✅ You can set diferent target repos for diferent labels.
  • ✅ You can create an action for every transference or movement you need or group all in one action.
  • ✅ Use it as it suits you. It's a lot versatile!. 👍😉

💡 TIP - You can create an issue template labeled by default as security risk and a private repo as target of this type of issues.
When someone reports a risk using the template, the issue will be automatically moved to the private repository you assigned to.

Try it => Send a Security Risk

💡 TIP - You can select multiple issues and asign the label spam for sending it to a spam repository.
When you want, you can easily clean this repo by recycling (delete / create it).
You also may create an action that periodically do this for you or just do a clean up by removing all issues.

IMPORTANT - By unknown reasons, any previously existing label on the issue will be removed during the process.

Credits

This project is an encapsulation of the great work of: octokit/graphql-action
Combined with GitHub - Actions and GitHub Api - GraphQL




Getting Started

With this script, you would be able to set a label that will be used to transfer issues to another repository.
When the action is listening the event "labeled" and you set the right label to one or more issues, the event is triggered and the action transfers the issue(s) to the repo you set as target of this type of issues.

Some steps are requiered to use this workflow:

  1. Create an action with the content of the script => Transfer_Issues_by_label.yml

    • Go to: Actions > New workflow > Setup a workflow yourself. Then, replace the content with the script copied.
  2. Create a personal access token (PAT) with repo access permissions. (Check all repo permissions)

    • Go to: User Settings > Developer settings > Personal access tokens > Generate new access token. Then, copy the token.
  3. Create a secret with name ACTIONSYNC and the PAT created before.

    ℹ - Must be at the source repo, where the action is running.
    ⚠ - If you are not the target repo owner, the target owner must create the same token PAT. (step 2)

    • Go to: Repo Settings > Secrets > New repository secret. Then, paste the token copied at step 2.
  4. Create a repo as target or use an existing one

    • If you want to use the variables by default, name the target repo like SourceRepoNamePrivate
    • If you want to use an existing one, change the value of the variable TargetRepo.
    • If you want to send confidential data to the target, like security risks, set this repo as Private.
  5. Change the variables for the action created at step 1 as your convenience.

    • For most cases, just need to change LabelName for the name of the label you want to use for triggering the action.

      ℹ - Any other variables are set by default with the owner and source repo where the action is running and the target repo as SourceOwner/SourceRepoNamePrivate.

    • For different scenarios, change any variable at your convenience.

Variable definitions

LabelName - The name of the label that triggers the action to transfer the issue.
GITHUB_TOKEN - Personal access token (PAT) or repo secret with PAT.
SourceOwner - The source repository owner where the action is running and the issue will be moved from.
SourceRepo - The source repository where the action is running and the issue will be moved from.
TargetOwner - The target repository owner where the issue will be moved to.
TargetRepo - The target repository where the issue will be moved to.




Support Development

If you find useful my work, please, consider to support development. 😉

You may also add me to your credits for more diffusion: ![Astorcamon](https://github.com/Astorcamon)

Thank you so much 😊

Paypal Github