You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-center/register-apis-github-actions.md
+13-17Lines changed: 13 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Register APIs using GitHub Actions - Azure API Center
3
3
description: Learn how to automate the registration of APIs in your API center using a CI/CD workflow based on GitHub Actions.
4
4
ms.service: azure-api-center
5
5
ms.topic: how-to
6
-
ms.date: 07/24/2024
6
+
ms.date: 12/23/2024
7
7
ms.author: danlep
8
8
author: dlepow
9
9
ms.custom: devx-track-azurecli
@@ -20,9 +20,9 @@ The following diagram shows how API registration in your API center can be autom
20
20
21
21
:::image type="content" source="media/register-apis-github-actions/scenario-overview.svg" alt-text="Diagram showing steps to trigger a GitHub actions workflow to register an API in an Azure API center." lightbox="media/register-apis-github-actions/scenario-overview.svg":::
22
22
23
-
1. Set up a GitHub Actions workflow in your repository that triggers when a pull request that adds an API definition file is merged.
23
+
1. Set up a GitHub Actions workflow in your repository that triggers when a pull request adding an API definition file is merged.
24
24
1. Create a branch from the main branch in your GitHub repository.
25
-
1. Add an API definition file, commit the changes, and push them to the new branch.
25
+
1. Add an API definition file, commit the changes, and push to the new branch.
26
26
1. Create a pull request to merge the new branch into the main branch.
27
27
1. Merge the pull request.
28
28
1. The merge triggers a GitHub Actions workflow that registers the API in your API center.
@@ -133,37 +133,32 @@ In this example:
133
133
To configure the workflow file:
134
134
135
135
1. Copy and save the file under a name such as `register-api.yml`.
136
-
1. Update the values for the environment variables to match your API center in Azure.
137
136
1. Confirm or update the name of the repository folder (`APIs`) where you'll add the API definition file.
138
137
1. Add this workflow file in the `/.github/workflows/` path in your GitHub repository.
138
+
1. Set the [Actions variables](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables) `SERVICE_NAME` and `RESOURCE_GROUP` in your repo for your API center name and resource group name in Azure.
139
139
140
140
> [!TIP]
141
-
> Using the [Visual Studio Code extension](build-register-apis-vscode-extension.md) for Azure API Center, you can generate a starting workflow file by running an extension command. In the Command Palette, select **Azure API Center: Register APIs**. Select **CI/CD** > **GitHub**. You can then modify the file for your scenario.
141
+
> Using the [Visual Studio Code extension](build-register-apis-vscode-extension.md) for Azure API Center, you can generate a starting workflow file by running an extension command. In the Command Palette, select **Azure API Center: Register APIs**. Select **CI/CD** > **GitHub**. You can then modify or extend the file for your scenario.
142
142
143
143
```yml
144
144
name: Register API Definition to Azure API Center
145
145
on:
146
146
pull_request:
147
-
types: [closed]
147
+
types: [closed]
148
148
branches:
149
-
- main
149
+
- [ "main" ]
150
150
paths:
151
151
- "APIs/**/*.json"
152
152
permissions:
153
153
contents: read
154
154
pull-requests: read
155
-
env:
156
-
# set this to your Azure API Center resource group name
0 commit comments