Skip to content

Commit

Permalink
PI-1795 Require approval for deployments while environment is disable…
Browse files Browse the repository at this point in the history
…d/read-only (#3256)
  • Loading branch information
marcus-bcl authored Feb 19, 2024
1 parent 3d86c0b commit 63fdbc9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/readonly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ jobs:
)
echo "projects=$json" | tee -a "$GITHUB_OUTPUT"
approval:
name: Update environment approval
if: inputs.environment != 'prod'
runs-on: ubuntu-latest
steps:
- run: jq -n "$reviewers" | gh api -XPUT '/repos/ministryofjustice/hmpps-probation-integration-services/environments/${{ inputs.environment }}' --input -
env:
reviewers: ${{ inputs.action == 'enable' && '{"reviewers":[{"type":"Team","id":5521382}]}' || '{"reviewers":[]}' }}
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

# Event publishers always require write access to the DB, so stop them while in read-only mode
event-publishers:
name: ${{ inputs.action == 'enable' && 'Stop' || 'Start' }} event publishers
Expand Down

0 comments on commit 63fdbc9

Please sign in to comment.