b2-sdk-python
b2-sdk-python copied to clipboard
.github/workflows/ci.yml should skip "cleanup_buckets" job if B2 credentials are not provided
Instead of skipping step by step
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