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.
This project is an encapsulation of the great work of: octokit/graphql-action
Combined with GitHub - Actions and GitHub Api - GraphQL
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:
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
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 |
---|---|