/googlesheet-actions

Github action for google spreadsheets to fetch data

Primary LanguageTypeScriptMIT LicenseMIT

enstars/googlesheet-actions

Github action for purposes of automating data from google sheets -> JSON files in our data repos. Not gonna be properly maintaining it for public use but feel free to PR or open an issue if you have any suggestions/ideas. Forked/written by @kamishirorui

Developing

Use command npm run build-pack && npx ts-node dist/index.js to run and test the script.


googlesheet-actions

Github action for google spreadsheets to fetch data.

Inputs

sheet-id

Required - string - Google spreadsheets id which is published on web.

Outputs

result

steps.googlesheet_actions.outputs.result - json - Get all data as json format. The output is dependant on the output input.

Example usage

Simple example

- name: googlesheet-actions
  uses: rjoydip/googlesheet-actions@0.1.1

Full example

# bare minimal
name: googlesheet

on:
    push:
      branches:
        - master

jobs:
    fetch:
      runs-on: ubuntu-latest
      steps:
        - id: googlesheet_actions
          uses: rjoydip/googlesheet-actions@0.1.1
          with:
            sheet-id: ${{ secrets.SHEET_ID }}
        - id: echo
          uses: actions/github-script@v2
          with:
            github-token: ${{secrets.GITHUB_TOKEN}}
            script: |
                console.log(${{steps.googlesheet_actions.outputs.result}})
        - name: test
          run: |
            cat $HOME/data.json

Getting Started

Create the Google spreadsheet and publish it: