diff --git a/.github/workflows/automated-deploy-stack.yml b/.github/workflows/automated-deploy-stack.yml index 6f34935d..d859748a 100644 --- a/.github/workflows/automated-deploy-stack.yml +++ b/.github/workflows/automated-deploy-stack.yml @@ -68,8 +68,12 @@ jobs: if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then changed=$(git diff --name-only origin/main... | tr '\n' ' ') fi - echo "DEBUG: Changed files: '$changed'" - echo "changed=$changed" >> $GITHUB_OUTPUT + if [ -z "$changed" ]; then + echo "No changed files detected." + else + echo "DEBUG: Changed files: '$changed'" + echo "changed=$changed" >> $GITHUB_OUTPUT + fi deductions-ci: if: contains(needs.get-changed-files.outputs.changed, 'stacks/mesh-forwarder') || contains(needs.get-changed-files.outputs.changed, '.github/workflows/automated-deploy-stack.yml') diff --git a/.github/workflows/deploy-stack.yml b/.github/workflows/deploy-stack.yml index c61cfc46..7ac0dbaf 100644 --- a/.github/workflows/deploy-stack.yml +++ b/.github/workflows/deploy-stack.yml @@ -69,6 +69,11 @@ on: default: false description: "Do we need to build any lambdas before deploying?" type: boolean + workflow_version: + default: v3 + description: "The workflow version to use when calling this workflow from another repo - e.g. v3" + type: string + required: false permissions: pull-requests: write @@ -151,7 +156,7 @@ jobs: with: repository: NHSDigital/orphaned-record-continuity-infrastructure fetch-depth: 0 - ref: ${{ github.ref }} + ref: ${{ !contains(github.repository, 'infrastructure') && inputs.workflow_version || github.ref }} - name: Configure AWS Credentials (ReadWrite) uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0