Secrets management

From Hack23/riksdagsmonitor · View interactive version

Secrets management is an AI agent skill from the GitHub repository Hack23/riksdagsmonitor. GitHub secrets and environment variables for MCP servers and CI/CD workflows

How to use this skill

Skill file

Secrets Management

🔴 AI FIRST Quality Principle

Apply the AI FIRST principle: never accept first-pass quality. Minimum 2 iterations. Read all output, improve every section. No shortcuts.

Purpose

Secure management of GitHub secrets for MCP servers and CI/CD workflows.

GitHub Secrets Configuration

Repository Secrets

# Settings → Secrets and variables → Actions → Repository secrets

COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN
  - Description: GitHub PAT for MCP server with Insiders API
  - Scopes: repo, read:org, read:user
  - Expiration: 90 days (renewal required)

Environment Secrets

# Settings → Environments → copilot → Environment secrets

COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN
  - Description: GitHub PAT for Copilot environment
  - Injected via: COPILOT_AGENT_INJECTED_SECRET_NAMES

Secret Usage in Workflows

MCP Configuration

// .github/copilot-mcp.json
{
  "mcpServers": {
    "github": {
      "env": {
        "GITHUB_TOKEN": "${{ secrets.COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN }}",
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN }}"
      }
    }
  }
}

Workflow Usage

# .github/workflows/copilot-setup-steps.yml
env:
  GITHUB_TOKEN: ${{ secrets.COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN }}
  GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN }}

Security Best Practices

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.