File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8484 deploy-compose :
8585 runs-on : ubuntu-latest
8686 needs : build-and-push
87- if : ${{ secrets.SSH_HOST != '' && secrets.SSH_USER != '' && secrets.SSH_PRIVATE_KEY != '' && (github.event_name != 'pull_request_target' || github.event.pull_request.head.repo.full_name == github.repository) }}
8887 environment : production
8988 concurrency :
9089 group : prod-deploy
@@ -101,6 +100,21 @@ jobs:
101100 with :
102101 ref : ${{ env.REF }}
103102
103+ - name : Verify required secrets are present
104+ env :
105+ SSH_HOST : ${{ secrets.SSH_HOST }}
106+ SSH_USER : ${{ secrets.SSH_USER }}
107+ SSH_PRIVATE_KEY : ${{ secrets.SSH_PRIVATE_KEY }}
108+ run : |
109+ for v in SSH_HOST SSH_USER SSH_PRIVATE_KEY; do
110+ if [ -z "${!v}" ]; then echo "Missing secret: $v"; exit 1; fi
111+ done
112+ - name : Verify PR origin (internal only)
113+ if : ${{ github.event_name == 'pull_request_target' }}
114+ run : |
115+ if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
116+ echo "Refusing to deploy from external fork PR"; exit 1; fi
117+
104118 - name : Upload docker-compose file
105119 uses : appleboy/scp-action@v0.1.7
106120 with :
You can’t perform that action at this time.
0 commit comments