google_form #79
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: Google Form Issue | |
| on: | |
| repository_dispatch: | |
| types: [google_form] | |
| permissions: | |
| issues: write | |
| contents: read | |
| jobs: | |
| create-issue: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Open issue with form response | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const payload = context.payload.client_payload; | |
| // Extract the word after "単語を入力してください:" if present | |
| const wordMatch = payload.content.match(/^単語を入力してください:\s*(.+)$/m); | |
| const word = wordMatch ? wordMatch[1].trim() : null; | |
| const titlePrefix = word | |
| ? `vocabulary: add 「${word}」` | |
| : 'Form response'; | |
| const title = `${titlePrefix} (${payload.filename})`; | |
| const body = [ | |
| 'Google Formに辞書追加のリクエストがありました。対応を検討してください。', | |
| '', | |
| '```', | |
| payload.content, | |
| '```' | |
| ].join('\n'); | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title, | |
| body | |
| }); |