diff --git a/app.json b/app.json index 0b96f779..790d172c 100644 --- a/app.json +++ b/app.json @@ -35,8 +35,8 @@ "description": "GitHub OAuth client secret", "value": "" }, - "GITHUB_INTEGRATION_ID": { - "description": "GitHub Integration ID", + "GITHUB_APP_ID": { + "description": "GitHub App ID", "value": "" }, "GITHUB_PRIVATE_KEY": { diff --git a/config/config.exs b/config/config.exs index d9b9c792..9e76eda1 100644 --- a/config/config.exs +++ b/config/config.exs @@ -9,7 +9,7 @@ use Mix.Config config :alloy_ci, ecto_repos: [AlloyCi.Repo], github_api: AlloyCi.Github.Live, - integration_id: System.get_env("GITHUB_INTEGRATION_ID"), + app_id: System.get_env("GITHUB_APP_ID"), app_url: System.get_env("GITHUB_APP_URL"), private_key: System.get_env("GITHUB_PRIVATE_KEY"), runner_registration_token: System.get_env("RUNNER_REGISTRATION_TOKEN"), diff --git a/config/prod.exs b/config/prod.exs index e5cdd3a1..1cd03144 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -13,7 +13,7 @@ use Mix.Config # which you typically run after static files are built. # General application configuration config :alloy_ci, - integration_id: "${GITHUB_INTEGRATION_ID}", + app_id: "${GITHUB_APP_ID}", app_url: "${GITHUB_APP_URL}", private_key: "${GITHUB_PRIVATE_KEY}", runner_registration_token: "${RUNNER_REGISTRATION_TOKEN}", diff --git a/config/test.exs b/config/test.exs index 24b5413a..022395ff 100644 --- a/config/test.exs +++ b/config/test.exs @@ -4,7 +4,7 @@ use Mix.Config config :alloy_ci, ecto_repos: [AlloyCi.Repo], github_api: AlloyCi.Github.Test, - integration_id: "1", + app_id: "1", app_url: "https://github.com/alloy-ci", private_key: "priv-key", runner_registration_token: "lustlmc3gMl59smZ", diff --git a/doc/README.md b/doc/README.md index 9120a28f..57e5e38f 100644 --- a/doc/README.md +++ b/doc/README.md @@ -61,7 +61,7 @@ Do so, and save the generated file. The contents of this file will be used for t `GITHUB_PRIVATE_KEY` environment variable. Don't lose this file, or you will have to generate a new key. -The `GITHUB_INTEGRATION_ID` appears on the right column, right at the end. +The `GITHUB_APP_ID` appears on the right column, right at the end. The `GITHUB_APP_URL` will be the public link to your app. This field will only show up, if you chose to make your installation public. @@ -131,7 +131,7 @@ The required variables are as follows: | SECRET_KEY_BASE | 65 chars long random string used to sign cookies | | GITHUB_CLIENT_ID | OAuth Client ID of your GitHub App | | GITHUB_CLIENT_SECRET | OAuth Client Secret of your GitHub App | -| GITHUB_INTEGRATION_ID | The ID of the installation created before | +| GITHUB_APP_ID | The ID of the App created before | | GITHUB_APP_URL | The URL where users can add the App to their accounts | | GITHUB_PRIVATE_KEY | The full private key used to sign GitHub's auth token | | GITHUB_SECRET_TOKEN | Integration token used to verify GitHub payloads | diff --git a/docker-compose.yml.example b/docker-compose.yml.example index ca46eea2..da0613fc 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -35,7 +35,7 @@ services: GITHUB_CLIENT_SECRET: "" GITHUB_SECRET_TOKEN: "" SECRET_KEY_BASE: "" - GITHUB_INTEGRATION_ID: "" + GITHUB_APP_ID: "" GITHUB_APP_URL: "https://github.com/apps/" # The private key for your GitHub integration. Each new line needs # to have a trailing line end and a backward slash \n\ in order to be diff --git a/lib/alloy_ci/github/github_live.ex b/lib/alloy_ci/github/github_live.ex index 48933b6f..a54f9adb 100644 --- a/lib/alloy_ci/github/github_live.ex +++ b/lib/alloy_ci/github/github_live.ex @@ -34,7 +34,7 @@ defmodule AlloyCi.Github.Live do def app_client do key = JOSE.JWK.from_pem(Application.get_env(:alloy_ci, :private_key)) - app_id = Application.get_env(:alloy_ci, :integration_id) + app_id = Application.get_env(:alloy_ci, :app_id) payload = %{ "iat" => DateTime.utc_now |> Timex.to_unix, diff --git a/test/builds/builds_test.exs b/test/builds/builds_test.exs index 87ef12aa..4535439c 100644 --- a/test/builds/builds_test.exs +++ b/test/builds/builds_test.exs @@ -85,7 +85,7 @@ defmodule AlloyCi.BuildsTest do "DATABASE_URL" => "postgres://postgres@postgres:5432/alloy_ci_test", "GITHUB_CLIENT_ID" => "fake-id", "GITHUB_CLIENT_SECRET" => "fake-secret", - "GITHUB_INTEGRATION_ID" => "1", + "GITHUB_APP_ID" => "1", "GITHUB_SECRET_TOKEN" => "fake-token", "MIX_ENV" => "test", "RUNNER_REGISTRATION_TOKEN" => "lustlmc3gMl59smZ", diff --git a/test/fixtures/broken_config.json b/test/fixtures/broken_config.json index 4bdcf93f..f26aa5e1 100644 --- a/test/fixtures/broken_config.json +++ b/test/fixtures/broken_config.json @@ -12,7 +12,7 @@ "GITHUB_SECRET_TOKEN": "fake-token", "GITHUB_DOMAIN": "github.com", "SECRET_KEY_BASE": "VfQZ5LWy5OdluDZ60vJjC8Rx8OUjYvswXRpUvuqFcf1qrrj7TtE", - "GITHUB_INTEGRATION_ID": 1, + "GITHUB_APP_ID": 1, "GITHUB_PRIVATE_KEY": "-----BEGIN RSA PRIVATE KEY-----", "DATABSE_URL": "postgres", "REDIS_URL" "redis://redis:6379" diff --git a/test/fixtures/full_features_config.json b/test/fixtures/full_features_config.json index b0342027..1b4200e6 100644 --- a/test/fixtures/full_features_config.json +++ b/test/fixtures/full_features_config.json @@ -23,7 +23,7 @@ "GITHUB_CLIENT_SECRET": "fake-secret", "GITHUB_SECRET_TOKEN": "fake-token", "SECRET_KEY_BASE": "NULr4xlNDNzEwE77UHdId7cQU+vuaPJ+Q5x3l+7dppQngBsL5EkjEaMu0S9cCGbk", - "GITHUB_INTEGRATION_ID": "1", + "GITHUB_APP_ID": "1", "DATABASE_URL": "postgres://postgres@postgres:5432/alloy_ci_test" }, "before_script": [