Skip to content

Commit 856058c

Browse files
committed
chore(workflows): enhance import-records workflow with image version input and update authentication method
Signed-off-by: Catarina Paralta <clouropa@cisco.com>
1 parent e856034 commit 856058c

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

.github/workflows/import-records.yaml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Import MCP Records
33
on:
44
workflow_dispatch:
55
inputs:
6+
image_version:
7+
required: true
8+
type: string
9+
default: v1.1.0
10+
description: "dirctl version to use"
611
import_config:
712
description: "JSON config file path or inline JSON content"
813
type: string
@@ -97,17 +102,10 @@ jobs:
97102
- name: Checkout code
98103
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
99104

100-
- name: Build dirctl from branch source
101-
id: build-dirctl
102-
uses: ./.github/actions/build-dirctl
103-
with:
104-
go_version: "1.26.1"
105-
106-
- name: Fetch Directory OIDC token (import)
107-
id: oidc-dir-import
108-
uses: ./.github/actions/fetch-oidc-token
105+
- name: Setup dirctl
106+
uses: ./.github/actions/setup-dirctl
109107
with:
110-
audience: dir
108+
version: ${{ inputs.image_version }}
111109

112110
- name: Install mcp-scanner
113111
if: ${{ env.SCANNER_ENABLED == 'true' }}
@@ -146,10 +144,10 @@ jobs:
146144
AZURE_OPENAI_BASE_URL: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
147145
AZURE_OPENAI_DEPLOYMENT: "gpt-4o"
148146
AZURE_OPENAI_API_VERSION: "2024-10-21"
149-
DIRECTORY_CLIENT_AUTH_MODE: "oidc"
147+
DIRECTORY_CLIENT_AUTH_MODE: "github"
150148
DIRECTORY_CLIENT_SERVER_ADDRESS: ${{ env.SERVER_ADDRESS }}
151-
DIRECTORY_CLIENT_OIDC_TOKEN: ${{ steps.oidc-dir-import.outputs.token }}
152-
DIRCTL_PATH: ${{ steps.build-dirctl.outputs.dirctl_path }}
149+
DIRECTORY_CLIENT_GITHUB_TOKEN: ${{ secrets.DIRECTORY_MCP_BOT_PAT }}
150+
DIRCTL_PATH: dirctl
153151
run: |
154152
echo "--- Processing Entry $((${{ matrix.entry.index }} + 1)) ---"
155153
@@ -204,28 +202,23 @@ jobs:
204202
# Output CIDs file path for signing step
205203
echo "cids_file=$CIDS_FILE" >> $GITHUB_OUTPUT
206204
207-
# Sign records with fresh OIDC tokens after import completes
208-
# This avoids token expiration issues during long-running imports
209-
- name: Fetch Directory OIDC token (sign)
210-
if: ${{ env.SIGN == 'true' && env.DRY_RUN == 'false' }}
211-
id: oidc-dir-sign
212-
uses: ./.github/actions/fetch-oidc-token
213-
214205
- name: Fetch Sigstore OIDC token
215206
if: ${{ env.SIGN == 'true' && env.DRY_RUN == 'false' }}
216207
id: oidc-sigstore
217208
uses: ./.github/actions/fetch-oidc-token
218209
with:
219210
audience: sigstore
220211

212+
# Sign records with fresh OIDC tokens after import completes
213+
# This avoids token expiration issues during long-running imports
221214
- name: Sign Imported Records
222215
if: ${{ env.SIGN == 'true' && env.DRY_RUN == 'false' }}
223216
env:
224-
DIRECTORY_CLIENT_AUTH_MODE: "oidc"
217+
DIRECTORY_CLIENT_AUTH_MODE: "github"
225218
DIRECTORY_CLIENT_SERVER_ADDRESS: ${{ env.SERVER_ADDRESS }}
226-
DIRECTORY_CLIENT_OIDC_TOKEN: ${{ steps.oidc-dir-sign.outputs.token }}
219+
DIRECTORY_CLIENT_GITHUB_TOKEN: ${{ secrets.DIRECTORY_MCP_BOT_PAT }}
227220
SIGSTORE_OIDC_TOKEN: ${{ steps.oidc-sigstore.outputs.token }}
228-
DIRCTL_PATH: ${{ steps.build-dirctl.outputs.dirctl_path }}
221+
DIRCTL_PATH: dirctl
229222
run: |
230223
CIDS_FILE="${{ steps.import.outputs.cids_file }}"
231224

0 commit comments

Comments
 (0)