|
| 1 | +# Creating a SIG-specific OTelBot GitHub App |
| 2 | + |
| 3 | +## Step 1: Create the GitHub App |
| 4 | + |
| 5 | +1. Navigate to the GitHub Apps creation page: |
| 6 | + - Go to: https://github.com/organizations/open-telemetry/settings/apps |
| 7 | + - Click "New GitHub App" |
| 8 | + |
| 9 | +2. Configure the basic app settings: |
| 10 | + - **GitHub App name**: `otelbot <short repo name>` |
| 11 | + - Example: `otelbot java contrib` |
| 12 | + - **Homepage URL**: The repository URL where the app will be primarily used |
| 13 | + - Example: `https://github.com/open-telemetry/opentelemetry-java-contrib` |
| 14 | + - **Webhook**: |
| 15 | + - **Active**: UNCHECKED |
| 16 | + - **Repository permissions**: |
| 17 | + - Configure based on the specific requirements provided in the community issue |
| 18 | + - Commonly requested permissions include: |
| 19 | + - Issues: Write |
| 20 | + - Pull requests: Write |
| 21 | + - Contents: Write |
| 22 | + |
| 23 | +3. Click "Create GitHub App" |
| 24 | + |
| 25 | +## Step 2: Configure App Display Information |
| 26 | + |
| 27 | +1. After creating the app, click on the app name to edit it |
| 28 | +2. Navigate to the "Display information" section |
| 29 | +3. **Upload a logo**: |
| 30 | + - Use the OpenTelemetry logo: https://avatars.githubusercontent.com/u/49998002?s=200&v=4 |
| 31 | + - Download the image and upload it as the app logo |
| 32 | + |
| 33 | +## Step 3: Generate and Store Private Key |
| 34 | + |
| 35 | +1. In the app settings, scroll down to the "Private keys" section |
| 36 | +2. Click "Generate a private key" |
| 37 | +3. Download the generated private key file (.pem) |
| 38 | +4. Create an organization secret: |
| 39 | + - Go to: https://github.com/organizations/open-telemetry/settings/secrets/actions/new |
| 40 | + - **Name**: `OTELBOT_<SHORT_REPO_NAME>_PRIVATE_KEY` |
| 41 | + - Example: `OTELBOT_JAVA_CONTRIB_PRIVATE_KEY` |
| 42 | + - **Secret**: Paste the contents of the downloaded .pem file |
| 43 | + - **Repository access**: |
| 44 | + - Select "Selected repositories" |
| 45 | + - Choose the repositories specified in the community issue |
| 46 | +5. Delete the locally downloaded .pem file |
| 47 | + |
| 48 | +## Step 4: Install the App |
| 49 | + |
| 50 | +1. Return to the GitHub App settings page |
| 51 | +2. Navigate to the "Install App" tab in the left sidebar |
| 52 | +3. Click the "Install" button next to the OpenTelemetry organization |
| 53 | +4. Configure installation: |
| 54 | + - Select "Only select repositories" |
| 55 | + - Choose the repositories specified in the community issue |
| 56 | +5. Click "Install" |
| 57 | + |
| 58 | +## Step 5: Create App ID Variable |
| 59 | + |
| 60 | +1. Navigate to the organization variables page: |
| 61 | + - Go to: https://github.com/organizations/open-telemetry/settings/variables/actions |
| 62 | +2. Click "New organization variable" |
| 63 | +3. Configure the variable: |
| 64 | + - **Name**: `OTELBOT_<SHORT_REPO_NAME>_APP_ID` |
| 65 | + - Example: `OTELBOT_JAVA_CONTRIB_APP_ID` |
| 66 | + - **Value**: The App ID (found in the GitHub App settings page) |
| 67 | + - **Repository access**: |
| 68 | + - Select "Selected repositories" |
| 69 | + - Choose the same repositories specified in the community issue |
| 70 | + |
| 71 | +## Step 6: Verify Installation |
| 72 | + |
| 73 | +1. Navigate to the target repositories |
| 74 | +2. Go to Settings → Integrations → GitHub Apps |
| 75 | +3. Verify that the new OTelBot app appears in the installed apps list |
| 76 | +4. Confirm that the app has the expected permissions |
| 77 | + |
| 78 | +## Usage in GitHub Actions |
| 79 | + |
| 80 | +Once set up, the SIG-specific OTelBot can be used in GitHub Actions workflows like this: |
| 81 | + |
| 82 | +```yaml |
| 83 | +- uses: actions/create-github-app-token@v1 |
| 84 | + id: app-token |
| 85 | + with: |
| 86 | + app-id: ${{ vars.OTELBOT_JAVA_CONTRIB_APP_ID }} |
| 87 | + private-key: ${{ secrets.OTELBOT_JAVA_CONTRIB_PRIVATE_KEY }} |
| 88 | + |
| 89 | +- name: Create pull request |
| 90 | + env: |
| 91 | + # Using the app token instead of GITHUB_TOKEN to trigger workflows |
| 92 | + GH_TOKEN: ${{ steps.app-token.outputs.token }} |
| 93 | + run: | |
| 94 | + # Your automation commands here |
| 95 | +``` |
| 96 | +
|
| 97 | +Note: you should continue to use the regular otelbot as the commit author since it is already on the EasyCLA allowlist: |
| 98 | +
|
| 99 | +```bash |
| 100 | +git config user.name otelbot |
| 101 | +git config user.email [email protected] |
| 102 | +``` |
| 103 | + |
0 commit comments