GitHub 設定で MY_SECRET という名前のリポジトリシークレットを作成する
このステップでは、既存の github-actions-demo リポジトリにシークレットを追加し、そのリポジトリを LabEx 環境にクローンします。
リポジトリシークレットの追加
- Web ブラウザを開き、GitHub 上の
github-actions-demo リポジトリに移動します:https://github.com/your-username/github-actions-demo
- Settings タブをクリックします。
- 左側のサイドバーで、Security セクションまでスクロールダウンし、Secrets and variables をクリックし、次に Actions を選択します。
- 緑色の New repository secret ボタンをクリックします。
- 以下の詳細を入力します:
- Name:
MY_SECRET
- Secret:
SuperSecretValue123
- Add secret をクリックします。
これで、「Repository secrets」の下に MY_SECRET がリストされているはずです。
リポジトリのクローン
次に、LabEx 環境に戻り、リポジトリをクローンします。
github-actions-demo の GitHub リポジトリページで、緑色の Code ボタンをクリックします。
- HTTPS タブが選択されていることを確認し、URL をコピーします。URL は
https://github.com/your-username/github-actions-demo.git のような形式になります。
- LabEx 環境でターミナルを開きます。デフォルトのパスは
~/project です。
git clone コマンドを使用してリポジトリをダウンロードします。your-username は実際の GitHub ユーザー名に置き換えてください。
cd ~/project
git clone https://github.com/your-username/github-actions-demo.git
出力例:
Cloning into 'github-actions-demo'...
remote: Enumerating objects: X, done.
remote: Counting objects: 100% (X/X), done.
remote: Total X (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (X/X), done.
- クローンしたリポジトリ内に移動します:
cd ~/project/github-actions-demo