
Managing GitHub Actions Secrets
FreeStreamline your GitHub Actions secret management.
Free · Opens the source repo
What Managing GitHub Actions Secrets does
Managing GitHub Actions secrets is crucial for maintaining security in CI/CD workflows. This skill is designed specifically for PostHog users who need to create and update secrets at the organization level, ensuring that sensitive information is not exposed at the repository level. By centralizing secrets management, it minimizes the risk of accidental leaks and simplifies access control across multiple repositories.
The skill emphasizes best practices for managing secrets, such as always creating them at the organization level rather than at the repository level. This approach allows for better control over which repositories can access specific secrets, reducing the likelihood of exposing sensitive data unnecessarily. Users are guided on how to set secrets using the gh CLI and the GitHub UI, ensuring that they follow the correct procedures to maintain security.
For those who frequently work with GitHub Actions in PostHog, this skill provides a clear and structured methodology for handling secrets. It covers common scenarios such as adding new secrets, updating existing ones, and ensuring that secrets are only accessible to the repositories that require them. The skill also includes important reminders about what not to do, such as avoiding the creation of repository-level secrets and not echoing secret values in logs or commands.
This skill is ideal for developers and DevOps engineers who want to ensure that their workflows remain secure while using GitHub Actions. By adhering to the guidelines provided, users can effectively manage secrets without compromising their organization's security posture.
When to use it
Use this skill when you need to create or update GitHub Actions secrets for PostHog workflows, particularly when managing access across multiple repositories.
When not to use it
This skill is not suitable for users who do not manage GitHub Actions secrets at the organization level or those who prefer repository-level secret management.
What you can build with it
Creating a New Secret
When adding a new API token for a PostHog workflow, use the CLI to securely create the secret at the organization level.
Updating Repository Access
If you need to change which repositories can access an existing secret, use the `gh secret set` command with the appropriate visibility options.
Migrating Secrets from Repo to Org
If you have repository-level secrets that should be organization-level, follow the migration steps to secure your secrets properly.
How to install Managing GitHub Actions Secrets
View source1. Install with the skills CLI
npx skills add posthog/posthog/managing-github-actions-secrets --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by posthogManaging GitHub Actions secrets for PostHog
PostHog centralizes all GitHub Actions secrets at the organization level and grants individual repositories access to them. Do not add secrets to a single repo, even if the secret is only consumed by one workflow today.
The rule
- Always create secrets on the
posthogorg, not on a repo. - Grant the secret to specific repos via the org-level access control (selected repositories). Do not make it available to all repos by default unless the secret is genuinely meant to be shared org-wide.
- Never paste secret values into chat, PR descriptions, commit messages, or files. Pipe them in, or paste them only into the GitHub UI's secret field.
Creating or updating a secret via gh CLI
Pipe the secret value into gh secret set with --org posthog. The example
below reads the value from stdin so it never appears in shell history:
# Read from clipboard / a pipe / a file — never inline as an argument
pbpaste | gh secret set POSTHOGOS_PACKAGER_KEY --org posthog
Common variants:
# From a file
gh secret set POSTHOGOS_PACKAGER_KEY --org posthog < secret.txt
# Restrict to selected repositories at creation time
gh secret set POSTHOGOS_PACKAGER_KEY --org posthog \
--visibility selected --repos PostHog/posthog,PostHog/posthog-foss
# Update which repos can access an existing org secret
gh secret set POSTHOGOS_PACKAGER_KEY --org posthog \
--visibility selected --repos PostHog/posthog
Verify:
gh secret list --org posthog | grep POSTHOGOS_PACKAGER_KEY
Creating or updating a secret via the GitHub UI
- Open https://github.com/organizations/PostHog/settings/secrets/actions.
- Click New organization secret (or the existing secret to update it).
- Set the Name (SCREAMING_SNAKE_CASE, descriptive, like
POSTHOGOS_PACKAGER_KEY). - Paste the Value.
- Under Repository access, choose Selected repositories and pick the exact repos that need it. Avoid All repositories unless the secret is safe to expose to every repo in the org.
- Click Add secret / Update secret.
What not to do
- Do not run
gh secret set NAMEwithout--org posthog— that creates a repo-level secret on whatever repoghis currently pointed at. - Do not navigate to
Settings → Secrets and variables → Actionson an individual repo to add a secret. If a repo-level secret already exists for something that should be org-level, migrate it (create at org, grant to the repo, then delete the repo-level copy). - Do not echo secret values in commands, logs, or files. If a value was accidentally exposed, rotate it immediately.
When the user asks "where do I add this secret?"
Default answer: at the org level via gh secret set --org posthog, granted
to the specific repos that need it. Only deviate if the user explicitly
overrides this (e.g. for an environment-scoped secret on a deployment
environment, which is a different mechanism).
Frequently asked questions about Managing GitHub Actions Secrets
Similar skills
Secret Scanning
Protect your code by preventing secret leaks.
MCP Security Audit
Ensure your MCP configurations are secure and compliant.
iMessage Access Management
Control access to your iMessage channel securely.
Implementing Secret Scanning with Gitleaks
Automate detection of hardcoded secrets in git repositories.
Secrets Vault Manager
Manage and secure your secret infrastructure efficiently.
AWS Secrets Manager
Safely manage secrets without exposing plaintext values.
