This document explains how to configure GitHub environments for manual approval when using the publish-nuget.yml template.
- Repository admin access to configure environments
- Understanding of GitHub repository settings
- Go to your repository on GitHub
- Navigate to Settings → Environments
- Click New environment
- Enter the environment name (default:
nuget-production) - Click Configure environment
In the environment configuration:
-
Required reviewers: Add users/teams who can approve deployments
- Minimum 1 reviewer recommended
- Consider adding multiple reviewers for redundancy
-
Wait timer (optional): Set a delay before deployment can proceed
- Useful for additional verification time
-
Deployment branches (optional): Restrict which branches can deploy
- Recommended:
mainbranch only for production deployments
- Recommended:
If you need environment-specific secrets:
- In the environment configuration, scroll to Environment secrets
- Add any environment-specific secrets (e.g., different NUGET_TOKEN for staging vs production)
Once the environment is configured, use the template like this:
jobs:
publish-nuget:
uses: dailydevops/pipelines/.github/workflows/publish-nuget.yml@main
with:
environment: "nuget-production" # Your configured environment name
secrets:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}When the workflow runs:
- The verify-build-status job runs automatically
- The publish-nuget job waits for manual approval
- Designated reviewers receive a notification
- Reviewers can approve/reject from the GitHub Actions UI
- Once approved, the publishing proceeds
- Use descriptive environment names (e.g.,
nuget-production,nuget-staging) - Set up multiple reviewers to avoid single points of failure
- Document your approval process for team members
- Consider using branch protection rules in addition to environment protection
- Regularly review and audit approved deployments
- Verify the environment name matches exactly (case-sensitive)
- Ensure the environment is created in the correct repository
- Add at least one reviewer to the environment protection rules
- Verify reviewers have appropriate repository permissions
- Check GitHub notification settings
- Verify reviewer email addresses and notification preferences
- Consider using teams instead of individual users for broader coverage