/start-11-2
Lesson command
$ npx -y skills add minicoohei/ai-agent-camp --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/start-11-2
Context preview
What this command does when you run it.
Lesson command
Command definition
start-11-2.mddescription: "Lesson command"
chapter: "courses/aiagent/lesson03-core/module11-github-actions"
prerequisites: ["start-11-1"]
duration: "約35分"
level: "intermediate"
tags: ["github-actions", "secrets", "google-api"]
nonInteractiveMode: incompatible
🎓 Lesson 11-2: GitHub Actions Secrets設定・Google連携
📍 このセッションでやること
**Lesson 11-2: GitHub ActionsとAPI連携** へようこそ!
| 項目 | 内容 | |------|------| | ゴール | GitHub ActionsでSecretsを利用し、Google API連携の自動データ取得・処理パイプラインを構築する | | 所要時間 | 約35分 | | 使うスキル | GitHub Actions, Repository Secrets, Google API | | 前提条件 | Lesson 11-1 完了、GitHub リポジトリ | | 教材ページ | [Module 11: GitHub Actions](https://ai-agent.camp/ja/course/module-11) を並行参照 |
**このセッションの流れ:** 1. Repository Secretsの設定 2. ワークフローからAPIの呼び出し 3. 自動データ取得・処理の実行
セッション終了時には、Secretsを利用した安全なAPI連携パイプラインが動くようになっています。
> **💡 ヒント**: AIの応答が途中で止まった場合は「続きを表示して」「止まってるよ」と入力すると再開します。これはCursorの仕様で、故障ではありません。
---
🎯 準備チェック
まずは準備が整っているか確認しましょう。
**AskQuestionの設定:**
{
"title": "🎯 セッション開始前の確認",
"questions": [{
"id": "readiness",
"prompt": "準備はできていますか?",
"options": [
{"id": "ready", "label": "準備OK!始めましょう"},
{"id": "check_prereq", "label": "前提条件を確認したい"},
{"id": "view_html", "label": "先に教材ページを見たい"},
{"id": "different_lesson", "label": "別のレッスンに移動したい"}
]
}]
}(ready → Step 1へ) (check_prereq → 前提条件の確認を実行) (view_html → 教材ページのパスを案内) (different_lesson → モジュール一覧を表示)
---
🚀 Step 1: Repository Secretsの設定
AskUserQuestion(AskQuestion)で「このまま進める / 例だけ確認 / スキップ」を選べます。
**AskQuestionの設定例:**
{
"title": "🚀 Step 1: Repository Secretsの設定",
"questions": [{
"id": "step_action",
"prompt": "このステップをどうしますか?",
"options": [
{"id": "practice", "label": "このまま進める"},
{"id": "review", "label": "例だけ確認する"},
{"id": "skip", "label": "スキップする"}
]
}]
}**選択後の案内(例)**: 入力内容:
GitHub Repository Secretsの設定手順を教えてください。
設定場所: リポジトリ > Settings > Secrets and variables > Actions
以下のSecretを設定する想定です:
- GOOGLE_CREDENTIALS(サービスアカウントキー)
- SLACK_WEBHOOK(通知用)
**期待される結果**: Secretsの設定手順が説明されます。実際の設定はGitHub Web UIで行います。
---
🚀 Step 2: Google認証ワークフロー
AskUserQuestion(AskQuestion)で「このまま進める / 例だけ確認 / スキップ」を選べます。
**AskQuestionの設定例:**
{
"title": "🚀 Step 2: Google認証ワークフロー",
"questions": [{
"id": "step_action",
"prompt": "このステップをどうしますか?",
"options": [
{"id": "practice", "label": "このまま進める"},
{"id": "review", "label": "例だけ確認する"},
{"id": "skip", "label": "スキップする"}
]
}]
}**選択後の案内(例)**: 入力内容:
> **推奨**: 可能であれば Workload Identity Federation (OIDC) を優先してください。 > サービスアカウントキーを使う場合は、JSON を1行に圧縮(minify)して Secrets に保存すると崩れにくくなります。
.github/workflows/google-auth.yml ファイルを作成し、以下の内容を記述してください:
name: Google API Integration
on:
workflow_dispatch:
inputs:
operation:
description: '実行する操作'
required: true
default: 'test'
type: choice
options:
- test
- fetch_data
- update_sheet
jobs:
google-operation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
uv add google-auth google-auth-oauthlib google-api-python-client
- name: Create credentials file
run: |
printf '%s' '${{ secrets.GOOGLE_CREDENTIALS }}' > credentials.json
chmod 600 credentials.json
- name: Test Google auth
if: github.event.inputs.operation == 'test'
run: |
python -c "
from google.oauth2 import service_account
import json
try:
creds = service_account.Credentials.from_service_account_file('credentials.json')
print('Google認証成功!')
print(f'サービスアカウント: {creds.service_account_email}')
except Exception as e:
print(f'認証エラー: {e}')
exit(1)
"
- name: Cleanup credentials
if: always()
run: rm -f credentials.json**期待される結果**: Google認証を安全に行うワークフローが作成されます。
---
🚀 Step 3: データ取得パイプライン
AskUserQuestion(AskQuestion)で「このまま進める / 例だけ確認 / スキップ」を選べます。
**AskQuestionの設定例:**
{
"title": "🚀 Step 3: データ取得パイプライン",
"questions": [{
"id": "step_action",
"prompt": "このステップをどうしますか?",
"options": [
{"id": "practice", "label": "このまま進める"},
{"id": "review", "label": "例だけ確認する"},
{"id": "skip", "label": "スキップする"}
]
}]
}**選択後の案内(例)**: 入力内容:
.github/workflows/data-pipeline.yml ファイルを作成し、以下の内容を記述してください:
name: Data Pipeline
on:
schedule:
- cron: '0 1 * * *' # 毎日 01:00 UTC
workflow_dispatch:
jobs:
data-pipeline:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
uv add pandas requests
- name: Step 1 - Fetch data
run: |
python -c "
import json
from datetime import datetime
# サンプルデータ生成(実際はAPIから取得)
data = {
'timestamp': datetime.now().isoformat(),
'records': [
{'id': 1, 'value': 100},
{'id': 2, 'value': 200},
{'id': 3, 'value': 300}
]
}
with open('data.json', 'w') as f:
json.dump(data, f)
print('データ取得完了')
"
- name: Step 2 - Process data
run: |
python -c "
import json
import pandas as pd
with open('data.json', 'r') as f:
data = json.load(f)
df = pd.DataFrame(data['records'])
df['processed_at'] = data['timestamp']
summary = {
'total_records': len(df),Read more
description: "Lesson command" chapter: "courses/aiagent/lesson03-core/module11-github-actions" prerequisites: ["start-11-1"] duration: "約35分" level: "intermediate" tags: ["github-actions", "secrets", "google-api"] nonInteractiveMode: incompatible
🎓 Lesson 11-2: GitHub Actions Secrets設定・Google連携
📍 このセッションでやること
**Lesson 11-2: GitHub ActionsとAPI連携** へようこそ!
| 項目 | 内容 | |------|------| | ゴール | GitHub ActionsでSecretsを利用し、Google API連携の自動データ取得・処理パイプラインを構築する | | 所要時間 | 約35分 | | 使うスキル | GitHub Actions, Repository Secrets, Google API | | 前提条件 | Lesson 11-1 完了、GitHub リポジトリ | | 教材ページ | [Module 11: GitHub Actions](https://ai-agent.camp/ja/course/module-11) を並行参照 |
**このセッションの流れ:** 1. Repository Secretsの設定 2. ワークフローからAPIの呼び出し 3. 自動データ取得・処理の実行
セッション終了時には、Secretsを利用した安全なAPI連携パイプラインが動くようになっています。
> **💡 ヒント**: AIの応答が途中で止まった場合は「続きを表示して」「止まってるよ」と入力すると再開します。これはCursorの仕様で、故障ではありません。
---
🎯 準備チェック
まずは準備が整っているか確認しましょう。
**AskQuestionの設定:**
{
"title": "🎯 セッション開始前の確認",
"questions": [{
"id": "readiness",
"prompt": "準備はできていますか?",
"options": [
{"id": "ready", "label": "準備OK!始めましょう"},
{"id": "check_prereq", "label": "前提条件を確認したい"},
{"id": "view_html", "label": "先に教材ページを見たい"},
{"id": "different_lesson", "label": "別のレッスンに移動したい"}
]
}]
}(ready → Step 1へ) (check_prereq → 前提条件の確認を実行) (view_html → 教材ページのパスを案内) (different_lesson → モジュール一覧を表示)
---
🚀 Step 1: Repository Secretsの設定
AskUserQuestion(AskQuestion)で「このまま進める / 例だけ確認 / スキップ」を選べます。
**AskQuestionの設定例:**
{
"title": "🚀 Step 1: Repository Secretsの設定",
"questions": [{
"id": "step_action",
"prompt": "このステップをどうしますか?",
"options": [
{"id": "practice", "label": "このまま進める"},
{"id": "review", "label": "例だけ確認する"},
{"id": "skip", "label": "スキップする"}
]
}]
}**選択後の案内(例)**: 入力内容:
GitHub Repository Secretsの設定手順を教えてください。 設定場所: リポジトリ > Settings > Secrets and variables > Actions 以下のSecretを設定する想定です: - GOOGLE_CREDENTIALS(サービスアカウントキー) - SLACK_WEBHOOK(通知用)
**期待される結果**: Secretsの設定手順が説明されます。実際の設定はGitHub Web UIで行います。
---
🚀 Step 2: Google認証ワークフロー
AskUserQuestion(AskQuestion)で「このまま進める / 例だけ確認 / スキップ」を選べます。
**AskQuestionの設定例:**
{
"title": "🚀 Step 2: Google認証ワークフロー",
"questions": [{
"id": "step_action",
"prompt": "このステップをどうしますか?",
"options": [
{"id": "practice", "label": "このまま進める"},
{"id": "review", "label": "例だけ確認する"},
{"id": "skip", "label": "スキップする"}
]
}]
}**選択後の案内(例)**: 入力内容:
> **推奨**: 可能であれば Workload Identity Federation (OIDC) を優先してください。 > サービスアカウントキーを使う場合は、JSON を1行に圧縮(minify)して Secrets に保存すると崩れにくくなります。
.github/workflows/google-auth.yml ファイルを作成し、以下の内容を記述してください:
name: Google API Integration
on:
workflow_dispatch:
inputs:
operation:
description: '実行する操作'
required: true
default: 'test'
type: choice
options:
- test
- fetch_data
- update_sheet
jobs:
google-operation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
uv add google-auth google-auth-oauthlib google-api-python-client
- name: Create credentials file
run: |
printf '%s' '${{ secrets.GOOGLE_CREDENTIALS }}' > credentials.json
chmod 600 credentials.json
- name: Test Google auth
if: github.event.inputs.operation == 'test'
run: |
python -c "
from google.oauth2 import service_account
import json
try:
creds = service_account.Credentials.from_service_account_file('credentials.json')
print('Google認証成功!')
print(f'サービスアカウント: {creds.service_account_email}')
except Exception as e:
print(f'認証エラー: {e}')
exit(1)
"
- name: Cleanup credentials
if: always()
run: rm -f credentials.json**期待される結果**: Google認証を安全に行うワークフローが作成されます。
---
🚀 Step 3: データ取得パイプライン
AskUserQuestion(AskQuestion)で「このまま進める / 例だけ確認 / スキップ」を選べます。
**AskQuestionの設定例:**
{
"title": "🚀 Step 3: データ取得パイプライン",
"questions": [{
"id": "step_action",
"prompt": "このステップをどうしますか?",
"options": [
{"id": "practice", "label": "このまま進める"},
{"id": "review", "label": "例だけ確認する"},
{"id": "skip", "label": "スキップする"}
]
}]
}**選択後の案内(例)**: 入力内容:
.github/workflows/data-pipeline.yml ファイルを作成し、以下の内容を記述してください:
name: Data Pipeline
on:
schedule:
- cron: '0 1 * * *' # 毎日 01:00 UTC
workflow_dispatch:
jobs:
data-pipeline:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
uv add pandas requests
- name: Step 1 - Fetch data
run: |
python -c "
import json
from datetime import datetime
# サンプルデータ生成(実際はAPIから取得)
data = {
'timestamp': datetime.now().isoformat(),
'records': [
{'id': 1, 'value': 100},
{'id': 2, 'value': 200},
{'id': 3, 'value': 300}
]
}
with open('data.json', 'w') as f:
json.dump(data, f)
print('データ取得完了')
"
- name: Step 2 - Process data
run: |
python -c "
import json
import pandas as pd
with open('data.json', 'r') as f:
data = json.load(f)
df = pd.DataFrame(data['records'])
df['processed_at'] = data['timestamp']
summary = {
'total_records': len(df),AI Agent Training for Non-Engineers - Complete Guide to Claude Code / Cursor / Codex ### ⚠️ Before you clone Official repository (maintained by the authors): Running AI agents from this repo grants them shell, file-write, and external-API permissions on your
Other commands on ai-agent-camp.
- /check-setup.en
Top-level alias — see lesson/check-setup.en.md for the full body.
Open command - /check-setup.es
Alias de nivel superior — el cuerpo completo está en lesson/check-setup.es.md.
Open command - /check-setup
Top-level alias — see lesson/check-setup.md for the full body.
Open command - /check-security.en
Lesson command
Open command - /check-security.es
Lesson command
Open command - /check-security
Lesson command
Open command

