Skip to content

Commit

Permalink
feat: Audit deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rockyj committed Jan 9, 2025
1 parent 599349d commit 8288570
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/approval.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Deployment Approval

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
issue_comment:
types: [created]
# pull_request:
# branches: [ master ]
# push:
# branches: [ master ]
# issue_comment:
# types: [created]
workflow_dispatch:

# 添加权限配置
permissions:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/env_approval.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Environment Deployment Approval

on:
workflow_dispatch:
push:
branches: [ master ]

permissions:
contents: read
deployments: write
actions: write

jobs:
deployment-approval:
runs-on: ubuntu-latest
environment: production-approval
timeout-minutes: 300
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Debug Event Info
run: |
echo "Event name: ${{ github.event_name }}"
echo "Ref: ${{ github.ref }}"
echo "SHA: ${{ github.sha }}"
echo "Actor: ${{ github.actor }}"
- name: Trigger Deploy Workflow
if: success()
uses: actions/github-script@v6
with:
github-token: ${{ secrets.WORKFLOW_PAT }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'deploy.yml',
ref: 'master'
})

0 comments on commit 8288570

Please sign in to comment.