diff --git a/.github/workflows/sync-spreadsheet.yml b/.github/workflows/sync-spreadsheet.yml new file mode 100644 index 0000000..70f416e --- /dev/null +++ b/.github/workflows/sync-spreadsheet.yml @@ -0,0 +1,40 @@ +name: "[M] Export to a Google spreadsheet" + +on: + workflow_dispatch: + inputs: + sheet: + description: 'The ID of the Google spreadsheet where data needs to be exported' + required: true + type: string + +jobs: + suggest-grid: + name: Export data to Google spreadsheet + runs-on: ubuntu-latest + steps: + - name: Setup node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Checkout latest version of release script + uses: actions/checkout@v4 + with: + ref: main + + - name: Install dependencies + run: npm ci + + - name: Dump key file + run: echo '${{ secrets.GOOGLE_KEY }}' > key.json + + - name: Export data + run: npx tpac-breakouts sync-sheet --sheet ${{ inputs.sheet }} + env: + PROJECT_OWNER: ${{ vars.PROJECT_OWNER_TYPE || 'organization' }}/${{ vars.PROJECT_OWNER || 'w3c' }} + PROJECT_NUMBER: ${{ vars.PROJECT_NUMBER }} + GRAPHQL_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + GH_TOKEN: ${{ secrets.GRAPHQL_TOKEN }} + W3CID_MAP: ${{ vars.W3CID_MAP }} + GOOGLE_KEY_FILE: key.json