From ec13b3d00de2c015e2e352f0458fba915d5c9d28 Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Mon, 14 Oct 2024 10:29:59 +0200 Subject: [PATCH] ci: ensure publishing of npm schema happens regardless of if app deploy is skipped (#1289) ## Description Ensures that the npm package is published when: - The deployment of apps has been skipped - The deployment of apps has been run successfully ## Related Issue(s) - #{issue number} ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) ## Summary by CodeRabbit - **New Features** - Enhanced CI/CD workflow to ensure critical jobs execute under broader conditions, improving reliability. - **Bug Fixes** - Adjusted job conditions to allow execution regardless of previous job outcomes, ensuring important tasks are not skipped. --- .github/workflows/ci-cd-main.yml | 2 +- .github/workflows/ci-cd-staging.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-main.yml b/.github/workflows/ci-cd-main.yml index bbfea4c5a..581503459 100644 --- a/.github/workflows/ci-cd-main.yml +++ b/.github/workflows/ci-cd-main.yml @@ -126,7 +126,7 @@ jobs: publish-schema-npm: name: Deploy schema npm package needs: [check-for-changes, get-current-version, generate-git-short-sha, deploy-apps-test] - if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true' }} + if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true') }} uses: ./.github/workflows/workflow-publish-schema.yml with: version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }} diff --git a/.github/workflows/ci-cd-staging.yml b/.github/workflows/ci-cd-staging.yml index e34585dd0..10d13a1ce 100644 --- a/.github/workflows/ci-cd-staging.yml +++ b/.github/workflows/ci-cd-staging.yml @@ -90,7 +90,7 @@ jobs: publish-schema-npm: name: Publish schema npm package needs: [check-for-changes, get-current-version, deploy-apps-staging] - if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true' }} + if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true') }} uses: ./.github/workflows/workflow-publish-schema.yml with: version: ${{ needs.get-current-version.outputs.version }}