From 825a681c9d4baeef0137f0f4fac9cd099b560465 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Fri, 6 Jun 2025 14:03:08 +0100 Subject: [PATCH 1/3] Copilot setup steps workflow: Comment out most steps to debug (#55968) --- .github/workflows/copilot-setup-steps.yml | 180 +++++++++++----------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 9d312abac0a5..a6178912ae0a 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -6,21 +6,21 @@ name: 'Copilot Environment Setup' on: workflow_dispatch: - inputs: - check_content: - description: 'Check content files with content linter' - required: false - default: true - type: boolean - check_scripts: - description: 'Check TypeScript/JavaScript/SCSS files with prettier and linter' - required: false - default: true - type: boolean - paths: - description: 'Specific file paths to check (space-separated), or leave empty for changed files' - required: false - type: string + # inputs: + # check_content: + # description: 'Check content files with content linter' + # required: false + # default: true + # type: boolean + # check_scripts: + # description: 'Check TypeScript/JavaScript/SCSS files with prettier and linter' + # required: false + # default: true + # type: boolean + # paths: + # description: 'Specific file paths to check (space-separated), or leave empty for changed files' + # required: false + # type: string permissions: contents: read @@ -28,7 +28,7 @@ permissions: jobs: copilot-setup-steps: if: github.repository == 'github/docs-internal' - runs-on: ${{ github.repository == 'github/docs-internal' && 'ubuntu-20.04-xl' || 'ubuntu-latest' }} + runs-on: ${{ github.repository == 'github/docs-internal' && 'ubuntu-latest' }} steps: - name: Check out repo @@ -37,83 +37,83 @@ jobs: - name: Set up Node and dependencies uses: ./.github/actions/node-npm-setup - - name: Get changed files if no specific paths provided - if: inputs.paths == '' - id: changed_files - uses: ./.github/actions/get-changed-files - with: - files: | - content/** - data/** - src/**/*.{ts,tsx,js,mjs} - **/*.scss + # - name: Get changed files if no specific paths provided + # if: inputs.paths == '' + # id: changed_files + # uses: ./.github/actions/get-changed-files + # with: + # files: | + # content/** + # data/** + # src/**/*.{ts,tsx,js,mjs} + # **/*.scss - - name: Set file paths for checking - id: set_paths - run: | - if [ -n "${{ inputs.paths }}" ]; then - echo "files_to_check=${{ inputs.paths }}" >> $GITHUB_OUTPUT - else - echo "files_to_check=${{ steps.changed_files.outputs.filtered_changed_files }}" >> $GITHUB_OUTPUT - fi + # - name: Set file paths for checking + # id: set_paths + # run: | + # if [ -n "${{ inputs.paths }}" ]; then + # echo "files_to_check=${{ inputs.paths }}" >> $GITHUB_OUTPUT + # else + # echo "files_to_check=${{ steps.changed_files.outputs.filtered_changed_files }}" >> $GITHUB_OUTPUT + # fi - - name: Run content linter on content/data files - if: inputs.check_content == true && (contains(steps.set_paths.outputs.files_to_check, 'content/') || contains(steps.set_paths.outputs.files_to_check, 'data/')) - env: - FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} - run: | - # Filter for content and data files only - CONTENT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '^(content|data)/' | tr '\n' ' ' || true) - if [ -n "$CONTENT_FILES" ]; then - echo "Running content linter on: $CONTENT_FILES" - npm run lint-content -- --paths $CONTENT_FILES - else - echo "No content or data files to check" - fi + # - name: Run content linter on content/data files + # if: inputs.check_content == true && (contains(steps.set_paths.outputs.files_to_check, 'content/') || contains(steps.set_paths.outputs.files_to_check, 'data/')) + # env: + # FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} + # run: | + # # Filter for content and data files only + # CONTENT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '^(content|data)/' | tr '\n' ' ' || true) + # if [ -n "$CONTENT_FILES" ]; then + # echo "Running content linter on: $CONTENT_FILES" + # npm run lint-content -- --paths $CONTENT_FILES + # else + # echo "No content or data files to check" + # fi - - name: Run prettier check on script files - if: inputs.check_scripts == true - env: - FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} - run: | - # Filter for TypeScript, JavaScript, and SCSS files - SCRIPT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '\.(ts|tsx|js|mjs|scss)$' | tr '\n' ' ' || true) - if [ -n "$SCRIPT_FILES" ]; then - echo "Running prettier check on: $SCRIPT_FILES" - npm run prettier-check -- $SCRIPT_FILES - else - echo "No script files to check with prettier" - fi + # - name: Run prettier check on script files + # if: inputs.check_scripts == true + # env: + # FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} + # run: | + # # Filter for TypeScript, JavaScript, and SCSS files + # SCRIPT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '\.(ts|tsx|js|mjs|scss)$' | tr '\n' ' ' || true) + # if [ -n "$SCRIPT_FILES" ]; then + # echo "Running prettier check on: $SCRIPT_FILES" + # npm run prettier-check -- $SCRIPT_FILES + # else + # echo "No script files to check with prettier" + # fi - - name: Run ESLint on script files - if: inputs.check_scripts == true - env: - FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} - run: | - # Filter for TypeScript and JavaScript files only (ESLint doesn't handle SCSS) - SCRIPT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '\.(ts|tsx|js|mjs)$' | tr '\n' ' ' || true) - if [ -n "$SCRIPT_FILES" ]; then - echo "Running ESLint on: $SCRIPT_FILES" - npx eslint $SCRIPT_FILES - else - echo "No JavaScript/TypeScript files to lint" - fi + # - name: Run ESLint on script files + # if: inputs.check_scripts == true + # env: + # FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} + # run: | + # # Filter for TypeScript and JavaScript files only (ESLint doesn't handle SCSS) + # SCRIPT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '\.(ts|tsx|js|mjs)$' | tr '\n' ' ' || true) + # if [ -n "$SCRIPT_FILES" ]; then + # echo "Running ESLint on: $SCRIPT_FILES" + # npx eslint $SCRIPT_FILES + # else + # echo "No JavaScript/TypeScript files to lint" + # fi - - name: Run TypeScript compiler check - if: inputs.check_scripts == true && (contains(steps.set_paths.outputs.files_to_check, '.ts') || contains(steps.set_paths.outputs.files_to_check, '.tsx')) - run: | - echo "Running TypeScript compiler check" - npm run tsc + # - name: Run TypeScript compiler check + # if: inputs.check_scripts == true && (contains(steps.set_paths.outputs.files_to_check, '.ts') || contains(steps.set_paths.outputs.files_to_check, '.tsx')) + # run: | + # echo "Running TypeScript compiler check" + # npm run tsc - - name: Environment setup summary - run: | - echo "✅ Copilot environment setup completed successfully!" - echo "" - echo "Available commands for content validation:" - echo "- Content linting: npm run lint-content -- --paths " - echo "- Prettier formatting: npm run prettier-check -- " - echo "- ESLint: npm run lint" - echo "- TypeScript check: npm run tsc" - echo "- All tests: npm test" - echo "" - echo "For more guidance, see .github/copilot-instructions.md" + # - name: Environment setup summary + # run: | + # echo "✅ Copilot environment setup completed successfully!" + # echo "" + # echo "Available commands for content validation:" + # echo "- Content linting: npm run lint-content -- --paths " + # echo "- Prettier formatting: npm run prettier-check -- " + # echo "- ESLint: npm run lint" + # echo "- TypeScript check: npm run tsc" + # echo "- All tests: npm test" + # echo "" + # echo "For more guidance, see .github/copilot-instructions.md" From 52ea38cc440a4ad4bd7f7e4666766bb4189e5f01 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Fri, 6 Jun 2025 15:34:51 +0100 Subject: [PATCH 2/3] Update copilot-setup-steps.yml --- .github/workflows/copilot-setup-steps.yml | 126 +++++----------------- 1 file changed, 28 insertions(+), 98 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index a6178912ae0a..22ecabcb6231 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -6,21 +6,6 @@ name: 'Copilot Environment Setup' on: workflow_dispatch: - # inputs: - # check_content: - # description: 'Check content files with content linter' - # required: false - # default: true - # type: boolean - # check_scripts: - # description: 'Check TypeScript/JavaScript/SCSS files with prettier and linter' - # required: false - # default: true - # type: boolean - # paths: - # description: 'Specific file paths to check (space-separated), or leave empty for changed files' - # required: false - # type: string permissions: contents: read @@ -34,86 +19,31 @@ jobs: - name: Check out repo uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Set up Node and dependencies - uses: ./.github/actions/node-npm-setup - - # - name: Get changed files if no specific paths provided - # if: inputs.paths == '' - # id: changed_files - # uses: ./.github/actions/get-changed-files - # with: - # files: | - # content/** - # data/** - # src/**/*.{ts,tsx,js,mjs} - # **/*.scss - - # - name: Set file paths for checking - # id: set_paths - # run: | - # if [ -n "${{ inputs.paths }}" ]; then - # echo "files_to_check=${{ inputs.paths }}" >> $GITHUB_OUTPUT - # else - # echo "files_to_check=${{ steps.changed_files.outputs.filtered_changed_files }}" >> $GITHUB_OUTPUT - # fi - - # - name: Run content linter on content/data files - # if: inputs.check_content == true && (contains(steps.set_paths.outputs.files_to_check, 'content/') || contains(steps.set_paths.outputs.files_to_check, 'data/')) - # env: - # FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} - # run: | - # # Filter for content and data files only - # CONTENT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '^(content|data)/' | tr '\n' ' ' || true) - # if [ -n "$CONTENT_FILES" ]; then - # echo "Running content linter on: $CONTENT_FILES" - # npm run lint-content -- --paths $CONTENT_FILES - # else - # echo "No content or data files to check" - # fi - - # - name: Run prettier check on script files - # if: inputs.check_scripts == true - # env: - # FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} - # run: | - # # Filter for TypeScript, JavaScript, and SCSS files - # SCRIPT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '\.(ts|tsx|js|mjs|scss)$' | tr '\n' ' ' || true) - # if [ -n "$SCRIPT_FILES" ]; then - # echo "Running prettier check on: $SCRIPT_FILES" - # npm run prettier-check -- $SCRIPT_FILES - # else - # echo "No script files to check with prettier" - # fi - - # - name: Run ESLint on script files - # if: inputs.check_scripts == true - # env: - # FILES_TO_CHECK: ${{ steps.set_paths.outputs.files_to_check }} - # run: | - # # Filter for TypeScript and JavaScript files only (ESLint doesn't handle SCSS) - # SCRIPT_FILES=$(echo "$FILES_TO_CHECK" | tr ' ' '\n' | grep -E '\.(ts|tsx|js|mjs)$' | tr '\n' ' ' || true) - # if [ -n "$SCRIPT_FILES" ]; then - # echo "Running ESLint on: $SCRIPT_FILES" - # npx eslint $SCRIPT_FILES - # else - # echo "No JavaScript/TypeScript files to lint" - # fi - - # - name: Run TypeScript compiler check - # if: inputs.check_scripts == true && (contains(steps.set_paths.outputs.files_to_check, '.ts') || contains(steps.set_paths.outputs.files_to_check, '.tsx')) - # run: | - # echo "Running TypeScript compiler check" - # npm run tsc - - # - name: Environment setup summary - # run: | - # echo "✅ Copilot environment setup completed successfully!" - # echo "" - # echo "Available commands for content validation:" - # echo "- Content linting: npm run lint-content -- --paths " - # echo "- Prettier formatting: npm run prettier-check -- " - # echo "- ESLint: npm run lint" - # echo "- TypeScript check: npm run tsc" - # echo "- All tests: npm test" - # echo "" - # echo "For more guidance, see .github/copilot-instructions.md" + # - name: Set up Node and dependencies + # uses: ./.github/actions/node-npm-setup + + # Running `node-npm-setup` in full to cache dependencies does not seem to work. + # Runing the remaining two steps manually for now which should be quicker. + + - name: Setup Node.js + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version-file: 'package.json' + cache: npm + + - name: Install dependencies + shell: bash + run: npm ci + + - name: Environment setup summary + run: | + echo "✅ Copilot environment setup completed successfully!" + echo "" + echo "Available commands for content validation:" + echo "- Content linting: npm run lint-content -- --paths " + echo "- Prettier formatting: npm run prettier-check -- " + echo "- ESLint: npm run lint" + echo "- TypeScript check: npm run tsc" + echo "- All tests: npm test" + echo "" + echo "For more guidance, see .github/copilot-instructions.md" From 3f9d4d27b5a22110af1f6158bcafbd3c4a37e3b2 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Fri, 6 Jun 2025 15:56:21 +0100 Subject: [PATCH 3/3] Delete .github/workflows/copilot-setup-steps.yml (#55970) --- .github/workflows/copilot-setup-steps.yml | 49 ----------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml deleted file mode 100644 index 22ecabcb6231..000000000000 --- a/.github/workflows/copilot-setup-steps.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: 'Copilot Environment Setup' - -# **What it does**: Sets up the environment for Copilot coding agent to test content and script changes. -# **Why we have it**: Ensures Copilot can validate content with linters and formatters before making changes. -# **Who does it impact**: Copilot coding agent and developers using repository custom instructions. - -on: - workflow_dispatch: - -permissions: - contents: read - -jobs: - copilot-setup-steps: - if: github.repository == 'github/docs-internal' - runs-on: ${{ github.repository == 'github/docs-internal' && 'ubuntu-latest' }} - - steps: - - name: Check out repo - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - # - name: Set up Node and dependencies - # uses: ./.github/actions/node-npm-setup - - # Running `node-npm-setup` in full to cache dependencies does not seem to work. - # Runing the remaining two steps manually for now which should be quicker. - - - name: Setup Node.js - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - with: - node-version-file: 'package.json' - cache: npm - - - name: Install dependencies - shell: bash - run: npm ci - - - name: Environment setup summary - run: | - echo "✅ Copilot environment setup completed successfully!" - echo "" - echo "Available commands for content validation:" - echo "- Content linting: npm run lint-content -- --paths " - echo "- Prettier formatting: npm run prettier-check -- " - echo "- ESLint: npm run lint" - echo "- TypeScript check: npm run tsc" - echo "- All tests: npm test" - echo "" - echo "For more guidance, see .github/copilot-instructions.md"