Skip to main content
Glama

github_secrets_guide

Learn how to use GitHub Secrets to securely store and manage sensitive data in your CI/CD workflows. This guide explains common patterns for implementing secrets in GitHub Actions.

Instructions

Explain GitHub Secrets and common patterns

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.js:1998-2091 (registration)
    Registration of the 'github_secrets_guide' tool via server.tool() call. Includes empty parameter schema {} and inline handler function.
      "github_secrets_guide",
      "Explain GitHub Secrets and common patterns",
      {},
      async () => {
        return {
          content: [{
            type: "text",
            text: `GITHUB SECRETS GUIDE
    ====================
    
    WHAT ARE SECRETS?
    -----------------
    Encrypted environment variables for your GitHub Actions workflows.
    They're never exposed in logs or to forked repositories.
    
    TYPES OF SECRETS:
    -----------------
    1. Repository Secrets
       - Available to all workflows in the repo
       - Set via: gh secret set NAME
    
    2. Environment Secrets
       - Tied to deployment environments (staging, production)
       - Can require approval before use
       - Set via: gh secret set NAME --env production
    
    3. Organization Secrets
       - Shared across multiple repos
       - Set in org settings
    
    BUILT-IN SECRETS (no setup needed):
    -----------------------------------
    - GITHUB_TOKEN: Auto-generated, used for GitHub API calls
      Permissions: read repo, write packages, etc.
    
    COMMON SECRETS TO SET UP:
    -------------------------
    Docker Hub:
      gh secret set DOCKER_USERNAME
      gh secret set DOCKER_PASSWORD
    
    AWS:
      gh secret set AWS_ACCESS_KEY_ID
      gh secret set AWS_SECRET_ACCESS_KEY
      gh secret set AWS_REGION
    
    Database:
      gh secret set DATABASE_URL
    
    API Keys:
      gh secret set API_KEY
      gh secret set SONAR_TOKEN
    
    SSH Deploy:
      gh secret set SSH_PRIVATE_KEY
    
    USING SECRETS IN WORKFLOWS:
    ---------------------------
    \`\`\`yaml
    jobs:
      deploy:
        runs-on: ubuntu-latest
        steps:
          - name: Login to Docker Hub
            uses: docker/login-action@v3
            with:
              username: \${{ secrets.DOCKER_USERNAME }}
              password: \${{ secrets.DOCKER_PASSWORD }}
    
          - name: Deploy
            run: ./deploy.sh
            env:
              DATABASE_URL: \${{ secrets.DATABASE_URL }}
              API_KEY: \${{ secrets.API_KEY }}
    \`\`\`
    
    SECURITY BEST PRACTICES:
    ------------------------
    1. Never commit secrets to code (use .env.example instead)
    2. Rotate secrets regularly
    3. Use environment secrets for production
    4. Limit secret access with environments + required reviewers
    5. Use OIDC for cloud providers when possible (no long-lived secrets)
    
    QUICK COMMANDS:
    ---------------
    List secrets:     gh secret list
    Set secret:       gh secret set SECRET_NAME
    Delete secret:    gh secret delete SECRET_NAME
    Set for env:      gh secret set SECRET_NAME --env production`
          }]
        };
      }
    );
  • Handler implementation: Returns a static markdown-formatted guide explaining GitHub Secrets, their types, usage, best practices, and common commands.
        return {
          content: [{
            type: "text",
            text: `GITHUB SECRETS GUIDE
    ====================
    
    WHAT ARE SECRETS?
    -----------------
    Encrypted environment variables for your GitHub Actions workflows.
    They're never exposed in logs or to forked repositories.
    
    TYPES OF SECRETS:
    -----------------
    1. Repository Secrets
       - Available to all workflows in the repo
       - Set via: gh secret set NAME
    
    2. Environment Secrets
       - Tied to deployment environments (staging, production)
       - Can require approval before use
       - Set via: gh secret set NAME --env production
    
    3. Organization Secrets
       - Shared across multiple repos
       - Set in org settings
    
    BUILT-IN SECRETS (no setup needed):
    -----------------------------------
    - GITHUB_TOKEN: Auto-generated, used for GitHub API calls
      Permissions: read repo, write packages, etc.
    
    COMMON SECRETS TO SET UP:
    -------------------------
    Docker Hub:
      gh secret set DOCKER_USERNAME
      gh secret set DOCKER_PASSWORD
    
    AWS:
      gh secret set AWS_ACCESS_KEY_ID
      gh secret set AWS_SECRET_ACCESS_KEY
      gh secret set AWS_REGION
    
    Database:
      gh secret set DATABASE_URL
    
    API Keys:
      gh secret set API_KEY
      gh secret set SONAR_TOKEN
    
    SSH Deploy:
      gh secret set SSH_PRIVATE_KEY
    
    USING SECRETS IN WORKFLOWS:
    ---------------------------
    \`\`\`yaml
    jobs:
      deploy:
        runs-on: ubuntu-latest
        steps:
          - name: Login to Docker Hub
            uses: docker/login-action@v3
            with:
              username: \${{ secrets.DOCKER_USERNAME }}
              password: \${{ secrets.DOCKER_PASSWORD }}
    
          - name: Deploy
            run: ./deploy.sh
            env:
              DATABASE_URL: \${{ secrets.DATABASE_URL }}
              API_KEY: \${{ secrets.API_KEY }}
    \`\`\`
    
    SECURITY BEST PRACTICES:
    ------------------------
    1. Never commit secrets to code (use .env.example instead)
    2. Rotate secrets regularly
    3. Use environment secrets for production
    4. Limit secret access with environments + required reviewers
    5. Use OIDC for cloud providers when possible (no long-lived secrets)
    
    QUICK COMMANDS:
    ---------------
    List secrets:     gh secret list
    Set secret:       gh secret set SECRET_NAME
    Delete secret:    gh secret delete SECRET_NAME
    Set for env:      gh secret set SECRET_NAME --env production`
          }]
        };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'explain' but doesn't disclose behavioral traits such as output format (text, markdown, structured), interactivity, or potential side effects (e.g., if it modifies state). This leaves the agent uncertain about what to expect from the tool's execution.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient phrase that directly states the tool's intent without unnecessary words. However, it could be more front-loaded with additional context (e.g., 'Provides documentation on...') to enhance clarity immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's conceptual nature (explaining vs. acting), lack of annotations, and no output schema, the description is incomplete. It doesn't specify what 'explain' entails (e.g., depth, examples, or structure), making it hard for an agent to assess if this meets user needs compared to other informational tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description doesn't need to compensate for missing parameter info, and it appropriately avoids discussing parameters since none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Explain GitHub Secrets and common patterns' states a general purpose (explaining a concept) but is vague about scope and format. It doesn't specify whether this provides documentation, examples, or step-by-step guidance, nor does it differentiate from sibling tools like 'github_secrets_set' or 'github_secrets_list' that perform concrete actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing GitHub access), appropriate contexts (e.g., learning vs. implementation), or relationships to sibling tools like 'github_secrets_set' for practical operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rideRTD/RTD-DevOps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server