GitHub Actions agent skill - helps create, review, and optimize workflows with up-to-date action versions and best practices
100
100%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Deployment environments with protection rules and secrets.
jobs:
deploy:
runs-on: ubuntu-latest
environment: production
steps:
- run: ./deploy.shjobs:
deploy:
runs-on: ubuntu-latest
environment:
name: production
url: https://example.com
steps:
- run: ./deploy.shThe URL appears in the GitHub UI and PR deployments.
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
steps:
- id: deploy
run: |
URL=$(./deploy.sh)
echo "url=$URL" >> $GITHUB_OUTPUTConfigure in Settings → Environments:
main, release/*jobs:
deploy-staging:
environment: staging
runs-on: ubuntu-latest
steps:
- run: ./deploy.sh
env:
API_KEY: ${{ secrets.API_KEY }} # Staging API key
deploy-production:
environment: production
runs-on: ubuntu-latest
steps:
- run: ./deploy.sh
env:
API_KEY: ${{ secrets.API_KEY }} # Production API keySame secret name, different values per environment.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
deploy-staging:
needs: build
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging.example.com
steps:
- uses: actions/download-artifact@v4
with:
name: dist
- run: ./deploy.sh staging
deploy-production:
needs: deploy-staging
runs-on: ubuntu-latest
environment:
name: production
url: https://example.com
steps:
- uses: actions/download-artifact@v4
with:
name: dist
- run: ./deploy.sh productionjobs:
test:
runs-on: ubuntu-latest
steps:
- run: npm test
deploy:
needs: test
runs-on: ubuntu-latest
environment: production # Requires approval
steps:
- run: ./deploy.shWith required reviewers configured:
name: Preview
on:
pull_request:
jobs:
deploy-preview:
runs-on: ubuntu-latest
environment:
name: preview-${{ github.event.pull_request.number }}
url: https://pr-${{ github.event.pull_request.number }}.preview.example.com
steps:
- uses: actions/checkout@v6
- run: ./deploy-preview.sh ${{ github.event.pull_request.number }}name: Cleanup Preview
on:
pull_request:
types: [closed]
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- run: ./cleanup-preview.sh ${{ github.event.pull_request.number }}Configure in Settings → Environments → Environment variables:
jobs:
deploy:
environment: production
runs-on: ubuntu-latest
steps:
- run: echo "Deploying to ${{ vars.DEPLOY_URL }}"jobs:
deploy:
environment: production
runs-on: ubuntu-latest
steps:
- run: ./deploy.sh
env:
DEPLOY_URL: ${{ vars.DEPLOY_URL }} # Variable
API_KEY: ${{ secrets.API_KEY }} # Secretjobs:
deploy:
runs-on: ubuntu-latest
environment: production
concurrency:
group: production-deploy
cancel-in-progress: false # Never cancel deploymentsjobs:
deploy:
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::ACCOUNT:role/ProductionRole
aws-region: us-east-1OIDC token includes environment claim for fine-grained access control.
# staging and production should be separate
environment: staging # Different secrets, different rules
environment: productionAlways require approval for production deployments.
Only allow main to deploy to production.
Use environment secrets, not repository secrets, for sensitive credentials.
environment:
name: production
url: https://example.com # Shows in GitHub UIAlways clean up when PR closes.
Settings → Environments → New environment
curl -X PUT \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/owner/repo/environments/productionresource "github_repository_environment" "production" {
repository = github_repository.repo.name
environment = "production"
reviewers {
users = [data.github_user.reviewer.id]
}
deployment_branch_policy {
protected_branches = true
custom_branch_policies = false
}
}GitHub tracks deployments:
View in repository → Deployments.
skills
actionista
agents
references