diff --git a/.github/workflows/test-copilot.yml b/.github/workflows/test-copilot.yml index e3e0cc8..be93636 100644 --- a/.github/workflows/test-copilot.yml +++ b/.github/workflows/test-copilot.yml @@ -6,8 +6,10 @@ jobs: copilot: runs-on: ubuntu-latest steps: - - uses: austenstone/copilot-cli@main + - uses: actions/checkout@v5 + - uses: ./ with: + github-token: ${{ secrets.PAT }} # Eventually remove for GITHUB_TOKEN? mcp-config: | { "mcpServers": { diff --git a/action.yml b/action.yml index f27bcb3..f097f7e 100644 --- a/action.yml +++ b/action.yml @@ -75,11 +75,7 @@ inputs: upload-artifact: description: 'Upload artifact after running Copilot' required: false - default: true - cache-cli: - description: 'Enable caching for npm packages' - required: false - default: 'false' + default: 'true' github-mcp-toolsets: description: 'Specify GitHub MCP toolsets to enable (e.g., "repos,issues,pull_requests,actions,code_security")' required: false @@ -94,30 +90,18 @@ outputs: runs: using: 'composite' steps: - - name: Configure Git credentials - run: | - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "${{ github.workflow }}" - shell: bash - uses: actions/setup-node@v4 + id: setup-node with: node-version: '22' - - name: Cache Copilot CLI - uses: actions/cache@v4 - if: ${{ inputs.cache-cli == 'true' }} - with: - path: ~/.npm - key: ${{ runner.os }}-copilot-cli-${{ inputs.copilot-version }} - restore-keys: | - ${{ runner.os }}-copilot-cli- + - run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "${{ github.workflow }}" + shell: bash - name: Install GitHub Copilot CLI run: | echo "::group::Installing GitHub Copilot CLI" - if [ "$COPILOT_VERSION" = "latest" ]; then - npm install -g @github/copilot - else - npm install -g @github/copilot@$COPILOT_VERSION - fi + npm install -g @github/copilot@$COPILOT_VERSION copilot --version || echo "Warning: Could not get copilot version" echo "::endgroup::" shell: bash @@ -167,6 +151,12 @@ runs: set +e # Don't exit on error + # Normalize boolean inputs to lowercase + ALLOW_ALL_TOOLS=$(echo "$ALLOW_ALL_TOOLS" | tr '[:upper:]' '[:lower:]') + NO_COLOR=$(echo "$NO_COLOR" | tr '[:upper:]' '[:lower:]') + SCREEN_READER=$(echo "$SCREEN_READER" | tr '[:upper:]' '[:lower:]') + SHOW_BANNER=$(echo "$SHOW_BANNER" | tr '[:upper:]' '[:lower:]') + # Build args array for safer execution with multi-line prompts COPILOT_ARGS=(-p "$PROMPT") @@ -247,6 +237,7 @@ runs: # Set outputs echo "logs_path=$HOME/.copilot/logs" >> $GITHUB_OUTPUT echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT + exit $EXIT_CODE env: GH_TOKEN: ${{ inputs.github-token }} PROMPT: ${{ inputs.prompt }}