Call Sheet Best from GitHub Actions
Sheet Best is a standard REST API. Any GitHub Actions workflow can call it from a run step using curl (or any HTTP client available to your runner) — no custom action required.
Before you start
- A Sheet Best connection. See the quickstart.
- A GitHub repository where you can add or edit workflows.
- If your connection is protected, store the key as a repository secret (for example
SHEETBEST_API_KEY). See API key authentication.
Reading rows (GET)
name: Read sheet
on: workflow_dispatch
jobs:
read:
runs-on: ubuntu-latest
steps:
- name: Fetch rows
env:
SHEETBEST_API_KEY: ${{ secrets.SHEETBEST_API_KEY }}
run: |
curl -sS \
-H "X-Api-Key: $SHEETBEST_API_KEY" \
"https://api.sheetbest.com/sheets/<id>"
Drop the -H "X-Api-Key: ..." line if your connection is unprotected. To filter, append a column/value to the URL (e.g. /Status/active) — see filtering and querying.
Writing rows (POST)
name: Append row
on:
push:
branches: [main]
jobs:
log:
runs-on: ubuntu-latest
steps:
- name: Append commit to sheet
env:
SHEETBEST_API_KEY: ${{ secrets.SHEETBEST_API_KEY }}
run: |
curl -sS -X POST \
-H "Content-Type: application/json" \
-H "X-Api-Key: $SHEETBEST_API_KEY" \
-d '{
"Commit": "${{ github.sha }}",
"Author": "${{ github.actor }}",
"Message": ${{ toJSON(github.event.head_commit.message) }}
}' \
"https://api.sheetbest.com/sheets/<id>"
The body can be a single object or an array of objects (one row per element). Field names must match your sheet's column headers.
Updating and deleting rows
The same pattern works with -X PATCH, -X PUT, and -X DELETE. Target a specific row by including a column match in the URL, for example:
curl -X PATCH \
-H "Content-Type: application/json" \
-d '{ "Status": "done" }' \
"https://api.sheetbest.com/sheets/<id>/Id/42"
See update rows and delete rows.