name: 'Expo Git Decrypt' description: 'Composite action to perform git secrets decryption.' inputs: key: description: 'An encrypted git key.' required: true runs: using: 'composite' steps: # OS labels for runners has been taken from docs: # * https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context - name: 🐙 Install git-crypt on Linux if: ${{ runner.os == 'Linux' }} shell: bash run: sudo apt-get install git-crypt - name: 🍺 Install git-crypt on macOS if: ${{ runner.os == 'macOS' }} shell: bash run: brew install git-crypt - name: 🔓 Decrypt secrets if possible env: GIT_CRYPT_KEY_BASE64: ${{ inputs.key }} shell: bash run: | if [[ ${GIT_CRYPT_KEY_BASE64:-unset} = unset ]]; then echo 'git-crypt key not present in environment' else git crypt unlock <(echo $GIT_CRYPT_KEY_BASE64 | base64 --decode) fi