Skip to content

google_form

google_form #84

Workflow file for this run

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
});