Implement agentic maintenance infrastructure for automated repository workflows #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Copilot Setup Steps" | |
| on: | |
| # Allow manual testing through the repository's "Actions" tab | |
| workflow_dispatch: {} | |
| # Automatically run the setup steps when an associated file is changed. | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/copilot-setup-steps.yml | |
| - qlt.conf.json | |
| - extractors/cds/tools/package.json | |
| - extractors/cds/tools/package-lock.json | |
| - javascript/frameworks/*/qlpack.yml | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - .github/workflows/copilot-setup-steps.yml | |
| - qlt.conf.json | |
| - extractors/cds/tools/package.json | |
| - extractors/cds/tools/package-lock.json | |
| - javascript/frameworks/*/qlpack.yml | |
| jobs: | |
| # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. | |
| copilot-setup-steps: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Install QLT | |
| id: install-qlt | |
| uses: advanced-security/codeql-development-toolkit/.github/actions/install-qlt@main | |
| with: | |
| qlt-version: 'latest' | |
| add-to-path: true | |
| - name: Install CodeQL | |
| id: install-codeql | |
| shell: bash | |
| run: | | |
| echo "Installing CodeQL using configuration from qlt.conf.json" | |
| qlt codeql run install | |
| echo "-----------------------------" | |
| # Get CodeQL paths from QLT | |
| CODEQL_HOME=$(qlt codeql get home) | |
| CODEQL_PATH=$(qlt codeql get path) | |
| echo "CodeQL Home: $CODEQL_HOME" | |
| echo "CodeQL Binary: $CODEQL_PATH" | |
| # Add CodeQL to PATH for subsequent steps | |
| if [[ -n "$CODEQL_HOME" ]]; then | |
| echo "$CODEQL_HOME" >> "$GITHUB_PATH" | |
| echo "✅ Added CodeQL to PATH: $CODEQL_HOME" | |
| else | |
| echo "❌ CodeQL home path not found" | |
| exit 1 | |
| fi | |
| - name: Verify CLI Tools in PATH | |
| shell: bash | |
| run: | | |
| echo "Verifying CLI tools are available in PATH:" | |
| if ! command -v qlt >/dev/null 2>&1; then | |
| echo "❌ qlt not found in PATH" | |
| exit 1 | |
| fi | |
| echo "✅ qlt is available: $(which qlt)" | |
| if ! command -v codeql >/dev/null 2>&1; then | |
| echo "❌ codeql not found in PATH" | |
| exit 1 | |
| fi | |
| echo "✅ codeql is available: $(which codeql)" | |
| - name: Verify Versions of Tooling | |
| shell: bash | |
| run: | | |
| echo "Checking CodeQL Version:" | |
| codeql --version | |
| echo "Checking QLT Version:" | |
| echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | |
| qlt version | |
| - name: Install QL Packs | |
| shell: bash | |
| run: | | |
| echo "Installing QL pack dependencies" | |
| codeql pack install --no-strict-mode javascript/frameworks/cap | |
| codeql pack install --no-strict-mode javascript/frameworks/ui5 | |
| codeql pack install --no-strict-mode javascript/frameworks/xsjs | |
| - name: Setup Node.js for CDS Extractor | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: extractors/cds/tools/package-lock.json | |
| - name: Install CDS Extractor Dependencies | |
| shell: bash | |
| working-directory: extractors/cds/tools | |
| run: | | |
| echo "Installing CDS extractor npm dependencies" | |
| npm ci | |
| - name: Build CDS Extractor | |
| shell: bash | |
| working-directory: extractors/cds/tools | |
| run: | | |
| echo "Building CDS extractor" | |
| npm run build | |
| - name: Verify Setup Complete | |
| shell: bash | |
| run: | | |
| echo "✅ Setup complete and verified:" | |
| echo " - QLT installed: $(qlt version)" | |
| echo " - QLT in PATH: $(which qlt)" | |
| echo " - CodeQL installed: $(codeql --version | head -1)" | |
| echo " - CodeQL in PATH: $(which codeql)" | |
| echo " - Node.js: $(node --version)" | |
| echo " - npm: $(npm --version)" | |
| echo " - CDS extractor built successfully" |