From a7c302ea8cde3e660320a3034de3c5bb70e17e41 Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Sun, 29 Mar 2026 21:09:56 -0500 Subject: [PATCH] chore: update .github/workflows/deploy-demo.yml from MokoStandards --- .github/workflows/deploy-demo.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 184799f..edb5269 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -22,7 +22,7 @@ # INGROUP: MokoStandards.Deploy # REPO: https://github.com/mokoconsulting-tech/MokoStandards # PATH: /templates/workflows/shared/deploy-demo.yml -# VERSION: 04.01.00 +# VERSION: 04.02.08 # BRIEF: SFTP deployment workflow for demo server — synced to all governed repos # NOTE: Synced via bulk-repo-sync to .github/workflows/deploy-demo.yml in all governed repos. # Port is resolved in order: DEMO_FTP_PORT variable → :port suffix in DEMO_FTP_HOST → 22. @@ -70,6 +70,9 @@ permissions: contents: read pull-requests: write +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: check-permission: name: Verify Deployment Permission @@ -241,7 +244,6 @@ jobs: fi done $SKIP && continue - if [ -f ".gitignore" ]; then if [ -f ".gitignore" ]; then git check-ignore -q "$rel" 2>/dev/null && { IGNORED_FILES+=("$rel | .gitignore") @@ -345,8 +347,8 @@ jobs: # ── Platform-specific path safety guards ────────────────────────────── PLATFORM="" - if [ -f ".moko-standards" ]; then - PLATFORM=$(grep -E '^platform:' .moko-standards | sed 's/.*:[[:space:]]*//' | tr -d '"') + MOKO_FILE=".github/.mokostandards"; [ ! -f "$MOKO_FILE" ] && MOKO_FILE=".mokostandards"; if [ -f "$MOKO_FILE" ]; then + PLATFORM=$(grep -E '^platform:' "$MOKO_FILE" | sed 's/.*:[[:space:]]*//' | tr -d '"') fi if [ "$PLATFORM" = "crm-module" ]; then @@ -407,7 +409,7 @@ jobs: - name: Setup PHP if: steps.source.outputs.skip == 'false' && steps.remote.outputs.skip != 'true' - uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.31.0 + uses: shivammathur/setup-php@fcafdd6392932010c2bd5094439b8e33be2a8a09 # v2.37.0 with: php-version: '8.1' tools: composer @@ -418,14 +420,17 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }} COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_TOKEN || github.token }}"}}' run: | - git clone --depth 1 --quiet \ + git clone --depth 1 --branch version/04.02.12 --quiet \ "https://x-access-token:${GH_TOKEN}@github.com/mokoconsulting-tech/MokoStandards.git" \ /tmp/mokostandards cd /tmp/mokostandards composer install --no-dev --no-interaction --quiet - - name: Clear remote destination folder - if: steps.source.outputs.skip == 'false' && steps.remote.outputs.skip != 'true' + - name: Clear remote destination folder (manual only) + if: >- + steps.source.outputs.skip == 'false' && + steps.remote.outputs.skip != 'true' && + inputs.clear_remote == true env: SFTP_HOST: ${{ steps.conn.outputs.host }} SFTP_PORT: ${{ steps.conn.outputs.port }} @@ -578,7 +583,7 @@ jobs: rm -f /tmp/deploy_key /tmp/sftp-config.json - name: Create or update failure issue - if: failure() + if: failure() && steps.remote.outputs.skip != 'true' env: GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }} run: | @@ -620,22 +625,22 @@ jobs: --force 2>/dev/null || true # Look for an existing open deploy-failure issue - EXISTING=$(gh api "repos/${REPO}/issues?labels=${LABEL}&state=open&per_page=1" \ + EXISTING=$(gh api "repos/${REPO}/issues?labels=${LABEL}&state=all&per_page=1&sort=created&direction=desc" \ --jq '.[0].number' 2>/dev/null) if [ -n "$EXISTING" ] && [ "$EXISTING" != "null" ]; then gh api "repos/${REPO}/issues/${EXISTING}" \ -X PATCH \ -f title="$TITLE" \ - -f body="$BODY" \ + -f body="$BODY" \n -f state="open" \ --silent - echo "📋 Failure issue #${EXISTING} updated: ${REPO}" >> "$GITHUB_STEP_SUMMARY" + echo "📋 Failure issue #${EXISTING} updated/reopened: ${REPO}" >> "$GITHUB_STEP_SUMMARY" else gh issue create \ --repo "$REPO" \ --title "$TITLE" \ --body "$BODY" \ - --label "$LABEL" \ + --label "$LABEL" \n --assignee "jmiller-moko" \ | tee -a "$GITHUB_STEP_SUMMARY" fi