{"meta":{"title":"Creating workflow templates for your organization","intro":"Learn how you can create workflow templates to help people in your team add new workflows more easily.","product":"GitHub Actions","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/actions","title":"GitHub Actions"},{"href":"/en/enterprise-cloud@latest/actions/how-tos","title":"How-tos"},{"href":"/en/enterprise-cloud@latest/actions/how-tos/reuse-automations","title":"Reuse automations"},{"href":"/en/enterprise-cloud@latest/actions/how-tos/reuse-automations/create-workflow-templates","title":"Create workflow templates"}],"documentType":"article"},"body":"# Creating workflow templates for your organization\n\nLearn how you can create workflow templates to help people in your team add new workflows more easily.\n\n## Creating workflow templates\n\nThis procedure demonstrates how to create a workflow template and metadata file. The metadata file describes how the workflow templates will be presented to users when they are creating a new workflow.\n\n1. If it doesn't already exist, create a new  repository named `.github` in your organization.\n\n2. Create a directory named `workflow-templates`.\n\n3. Create your new workflow file inside the `workflow-templates` directory.\n\n   If you need to refer to a repository's default branch, you can use the `$default-branch` placeholder. When a workflow is created the placeholder will be automatically replaced with the name of the repository's default branch.\n\n   For example, this file named `octo-organization-ci.yml` demonstrates a basic workflow.\n\n   ```yaml copy\n   name: Octo Organization CI\n\n   on:\n     push:\n       branches: [ $default-branch ]\n     pull_request:\n       branches: [ $default-branch ]\n\n   jobs:\n     build:\n       runs-on: ubuntu-latest\n\n       steps:\n         - uses: actions/checkout@v6\n\n         - name: Run a one-line script\n           run: echo Hello from Octo Organization\n   ```\n\n4. Create a metadata file inside the `workflow-templates` directory. The metadata file must have the same name as the workflow file, but instead of the `.yml` extension, it must be appended with `.properties.json`. For example, this file named `octo-organization-ci.properties.json` contains the metadata for a workflow file named `octo-organization-ci.yml`:\n\n   ```json copy\n   {\n       \"name\": \"Octo Organization Workflow\",\n       \"description\": \"Octo Organization CI workflow template.\",\n       \"iconName\": \"example-icon\",\n       \"categories\": [\n           \"Go\"\n       ],\n       \"filePatterns\": [\n           \"package.json$\",\n           \"^Dockerfile\",\n           \".*\\\\.md$\"\n       ]\n   }\n   ```\n\n   * `name` - **Required.** The name of the workflow. This is displayed in the list of available workflows.\n   * `description` - **Required.** The description of the workflow. This is displayed in the list of available workflows.\n   * `iconName` - **Optional.** Specifies an icon for the workflow that is displayed in the list of workflows. `iconName` can be one of the following types:\n     * An SVG file that is stored in the `workflow-templates` directory. To reference a file, the value must be the file name without the file extension. For example, an SVG file named `example-icon.svg` is referenced as `example-icon`.\n     * An icon from GitHub's set of [Octicons](https://primer.style/octicons/). To reference an octicon, the value must be `octicon <icon name>`. For example, `octicon smiley`.\n   * `categories` - **Optional.** Defines the categories that the workflow is shown under. You can use category names from the following lists:\n     * General category names from the [starter-workflows](https://github.com/actions/starter-workflows/blob/main/README.md#categories) repository.\n     * Linguist languages from the list in the [linguist](https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml) repository.\n     * Supported tech stacks from the list in the [starter-workflows](https://github.com/github-starter-workflows/repo-analysis-partner/blob/main/tech_stacks.yml) repository.\n   * `filePatterns` - **Optional.** Allows the workflow to be used if the user's repository has a file in its root directory that matches a defined regular expression.\n\n5. To add another workflow template, add your files to the same `workflow-templates` directory.\n\n## Next steps\n\n* For reference information about workflow templates, see [Reusing workflow configurations](/en/enterprise-cloud@latest/actions/reference/workflows-and-actions/reusing-workflow-configurations#workflow-templates)."}