From 9c485d44569fd0f22e2b8c555cf3c8793a3e6acd Mon Sep 17 00:00:00 2001 From: Diane Batres Date: Fri, 12 Sep 2025 13:27:19 -0700 Subject: [PATCH] add ai generation workflow files to template --- .github/workflows/ai-initialize-metadata.yml | 37 ++++++++++++++++ .github/workflows/ai-nightly-refresh.yml | 46 ++++++++++++++++++++ .github/workflows/ai-pr-request.yml | 36 +++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 .github/workflows/ai-initialize-metadata.yml create mode 100644 .github/workflows/ai-nightly-refresh.yml create mode 100644 .github/workflows/ai-pr-request.yml diff --git a/.github/workflows/ai-initialize-metadata.yml b/.github/workflows/ai-initialize-metadata.yml new file mode 100644 index 0000000..8489f9f --- /dev/null +++ b/.github/workflows/ai-initialize-metadata.yml @@ -0,0 +1,37 @@ +--- +############################################################ +############################################################ +## Initial AI Generation Metadata and FAQs for all Files ## +############################################################ +############################################################ + +name: Initial AI Generation + +###################################################### +# Start the job on an initial AI metadata generaton # +###################################################### + +on: + workflow_dispatch: + inputs: + target_branch: + description: "Target branch to send PR to (e.g., main, stage, etc)" + type: string + required: false + default: "main" + folder_path: + description: "Folder path to read files from (defaults to src/pages)" + type: string + required: false + default: "src/pages" +jobs: + ai-metadata-update: + name: AI Metadata Update on Deployment + uses: AdobeDocs/adp-devsite-workflow/.github/workflows/ai-deploy-metadata.yml@main + with: + FILE_NAME: "all_pages_content.txt" + TARGET_BRANCH: ${{ inputs.target_branch }} + FOLDER_PATH: ${{ inputs.folder_path }} + secrets: + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/ai-nightly-refresh.yml b/.github/workflows/ai-nightly-refresh.yml new file mode 100644 index 0000000..7c6da3c --- /dev/null +++ b/.github/workflows/ai-nightly-refresh.yml @@ -0,0 +1,46 @@ +--- +################################### +################################### +## Nightly Refresh AI generation ## +################################### +################################### + +name: Nightly AI Metadata Refresh + +###################################################### +# Start the job on a refresh for AI metadata generaton # +###################################################### + +on: + # schedule: + # - cron: '0 2 * * *' + workflow_dispatch: + inputs: + baseSha: + description: "Use base SHA commit to compare changes from (empty string defaults to last commit before HEAD)" + type: string + required: false + default: "" + target_branch: + description: "Target branch to send PR to (e.g., main, stage, etc)" + type: string + required: false + default: "main" + folder_path: + description: "Folder path to read files from (defaults to src/pages)" + type: string + required: false + default: "src/pages" + +jobs: + ai-metadata-update: + name: AI Metadata Update with Changed Files + uses: AdobeDocs/adp-devsite-workflow/.github/workflows/ai-metadata-changed-files.yml@main + with: + baseSha: ${{ inputs.baseSha }} + TARGET_BRANCH: ${{ inputs.target_branch }} + FILE_NAME: "changed_content.txt" + FOLDER_PATH: ${{ inputs.folder_path }} + secrets: + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/ai-pr-request.yml b/.github/workflows/ai-pr-request.yml new file mode 100644 index 0000000..e5e2581 --- /dev/null +++ b/.github/workflows/ai-pr-request.yml @@ -0,0 +1,36 @@ +--- +############################################## +############################################## +## Pull Request with AI Metadata Generation ## +############################################## +############################################## + +name: AI Metadata Pull Request + +###################################################### +# Start the job on a pull request to the specified branch # +###################################################### + +on: + pull_request: + branches: [main] + paths: + - 'src/pages/**' + +############### +# Set the Job # +############### +jobs: + call_reusable_workflow: + name: Generate AI Metadata + # Skip if PR title starts with "[AI PR] Metadata Update" or branch name starts with "ai-metadata" + if: >- + !startsWith(github.event.pull_request.title, '[AI PR] Metadata Update') || + !startsWith(github.event.pull_request.head.ref, 'ai-metadata') + uses: AdobeDocs/adp-devsite-workflow/.github/workflows/ai-pr-request-metadata.yml@main + with: + PR_ID: ${{ github.event.pull_request.number }} + FILE_NAME: "pr_content.txt" + secrets: + AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} \ No newline at end of file