Install and authorize Backblaze B2 CLI directly on a GitHub Actions Linux host.
After this action, every step is capable of running b2
CLI.
You must set 2 environment variables (secrets) B2_APPLICATION_KEY_ID
and B2_APPLICATION_KEY
to authenticate your cli.
Add the following step to a job in your workflow
- id: install-b2-cli
uses: andromidasj/install-b2-cli-action@v1.0.0
with:
version: v4.1.0 # default to latest
env:
B2_APPLICATION_KEY_ID: ${{ secrets.B2_APPLICATION_KEY_ID }}
B2_APPLICATION_KEY: ${{ secrets.B2_APPLICATION_KEY }}
name: Update CORS
on:
push:
jobs:
sync:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.4.0
- uses: andromidasj/install-b2-cli-action@v1.0.0
env:
B2_APPLICATION_KEY_ID: ${{ secrets.B2_APPLICATION_KEY_ID }}
B2_APPLICATION_KEY: ${{ secrets.B2_APPLICATION_KEY }}
...
- name: Update CORS
run: b2 bucket update --cors-rules "$(<./b2-cors.json)" myBucket allPrivate
Created and maintained by Sylvain Witmeyer Forked and updated by Josh Andromidas
This project is licensed under the MIT License - see the LICENSE file for details