diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2c90d5c..826d614 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,6 +7,11 @@ on: permissions: contents: read + # Needed to post a legacy commit status under context "CI" so that + # PR-management UIs that only read the older Statuses API (rather + # than the newer Check-Runs API) show the merge commits as green + # instead of stuck-on-pending. + statuses: write jobs: build-and-deploy: @@ -50,4 +55,23 @@ jobs: key: ${{ secrets.SSH_PRIVATE_KEY }} port: ${{ secrets.FTP_PORT }} script: | - chown -R www-data:www-data /var/www/html/docs_msk-scripts/ \ No newline at end of file + chown -R www-data:www-data /var/www/html/docs_msk-scripts/ + + - name: ✅ Post CI commit status (legacy API) + if: always() + uses: actions/github-script@v7 + with: + script: | + const state = '${{ job.status }}' === 'success' ? 'success' : 'failure'; + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: context.sha, + state, + context: 'CI', + description: + state === 'success' + ? 'Build + deploy green' + : 'Build or deploy failed — see workflow logs', + target_url: `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + }); \ No newline at end of file