b2-sdk-python icon indicating copy to clipboard operation
b2-sdk-python copied to clipboard

.github/workflows/ci.yml should skip "cleanup_buckets" job if B2 credentials are not provided

Open mpnowacki-reef opened this issue 4 years ago • 1 comments

Instead of skipping step by step

mpnowacki-reef avatar Jun 16 '21 07:06 mpnowacki-reef

problem seems to be in the fact if: on job level does not allow secrets in it i.e. The workflow is not valid. .github/workflows/ci.yml (Line: 56, Col: 9): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.B2_TEST_APPLICATION_KEY != '' && secrets.B2_TEST_APPLICATION_KEY_ID != ''

The solution most likely will be adding something like this to lint job which is already executed before it:

    outputs:
      has_secrets: ${{ steps.check.outputs.has_secrets }}
    steps:
      - id: secrets_check
        run: |
          if [ -z "${{ secrets.B2_TEST_APPLICATION_KEY }}" ] || [ -z "${{ secrets.B2_TEST_APPLICATION_KEY_ID }}" ]; then
            echo "::set-output name=has_secrets::false"
          else
            echo "::set-output name=has_secrets::true"
          fi

mjurbanski-reef avatar Nov 08 '23 21:11 mjurbanski-reef