GENESIS PT3.1~ #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Email to Google Sheets | ||
| on: | ||
| issues: | ||
| types: [opened] | ||
| jobs: | ||
| add-email: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: '14' | ||
| - name: Install dependencies | ||
| run: npm install | ||
| - name: Extract email from issue | ||
| id: extract-email | ||
| run: echo "EMAIL=$(echo '${{ github.event.issue.title }}' | sed 's/New subscription: //')" >> $GITHUB_ENV | ||
| - name: Run script to add email to Google Sheets | ||
| env: | ||
| GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }} | ||
| SPREADSHEET_ID: ${{ secrets.SPREADSHEET_ID }} | ||
| EMAIL_TO_ADD: ${{ env.EMAIL }} | ||
| run: node scripts/add-email-to-sheets.js | ||