Pre-requisites:
Set a personal access token policy for your organization
Follow the steps to create a Fine-grained personal access token and select the owner as the organization. The token will only be able to access resources owned by the selected resource owner. Organizations that you are a member of will not appear unless the organization opted in to fine-grained personal access tokens.
Give Read-Only access to Secrets. Keep in mind the GITHUB_TOKEN name as you will need it in the next step.
You can configure the level of access of the new secret but since we have only
on:
issues:
types: [opened]
jobs:
tag-a-user:
runs-on: ubuntu-latest
steps:
- uses: devops-actions/issue-comment-tag@v0.1.8
name: Tag a user or team in an issue comment
with:
issue: ${{ github.event.issue.number }}
team: kcodeg123
owner: ${{ github.repository_owner }}
repo: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
Under the Settings tab of the repository, go to Actions > General and update the permissions granted to the GITHUB_TOKEN under Workflow permissions to Read and write permissions.
To get notifications, ensure that your settings are updated to accept notifications.
When on the GitHub page, on the top right, click on your profile and select Settings. Go to Notifications and update Participating, @mentions and custom to notify you via GitHub and/or Email.
Create a new issue template for the repository to maintain the requests.
The .github/issue_template/request-new-action.yml
file is a GitHub issue template. This file will be used to create a structured format for new issues that are opened in your repository. This helps maintain consistency and clarity in the issues that are created.
Follow these steps to add code to the issue template:
Open the .github/issue_template/request-new-action.yml
file in your repository. If the file doesn't exist, create it.
Add the following code to the file.
name: Request new action
description: Request new action to be added to the internal marketplace
title: "New action request: <name of action here>"
assignees:
- rajbos
body:
- type: markdown
attributes:
value: |
Thanks you for your request. We need some information before we can proceed.
After that, the request will be reviewed including an security assesment. Process tracking will happen inside this issue.
Please tag '@-username' or '@-teamname' to notifiy them in comments.
- type: input
id: action_name
attributes:
label: Action name
description: The name of the action you want to request in the format owner/repository
placeholder: "uses: devops-actions/issue-comment-tag"
validations:
required: true
- type: textarea
id: reason
attributes:
label: Reasons
description: Why do you want to request this action?
render: shell
- type: textarea
id: usage
attributes:
label: Intended usage
description: Describe the intended use of the action you want to request, include example repositories if you can.
render: markdown
- type: checkboxes
id: duplication
attributes:
label: I have checked the internal marketplace for similar actions and couldn't find one that works for us.
options:
- label: I have checked the internal marketplace first
required: true
The above code defines the structure of the issue template. It includes the name, description, title, assignees, and body of the issue. The body includes input fields for the action name, reasons for the request, intended usage, and a checkbox to confirm that the internal marketplace has been checked for similar actions. You can customize the template further by adding more fields or modifying the existing ones to suit your needs.
After you've added the code to the issue template, whenever a new issue is created in your repository, the creator will have the option to use this template. The issue will then follow the structure defined in the template, making it easier for others to understand and respond to the issue.
Remember to always review the issues created in your repository and respond appropriately.
The steps to create a new issue are as follows:
The issue will be created with the structured format defined in the template, making it easier for the request to be reviewed and processed.