From 28305a2fa7649b372db05dd56159f8d7e95122ef Mon Sep 17 00:00:00 2001 From: mischa Date: Wed, 10 May 2023 16:04:56 -0700 Subject: [PATCH 1/2] Improve automating projects using Actions with GitHub App instructions (#36982) Co-authored-by: Sarah Edwards --- .../automating-projects-using-actions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions.md b/content/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions.md index db5135b9a6..de4e167572 100644 --- a/content/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions.md +++ b/content/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions.md @@ -38,7 +38,7 @@ You may also want to use the **actions/add-to-project** workflow, which is maint For more information about authenticating in a {% data variables.product.prodname_actions %} workflow with a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/guides/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow)." 1. Create a {% data variables.product.prodname_github_app %} or choose an existing {% data variables.product.prodname_github_app %} owned by your organization. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)." -2. Give your {% data variables.product.prodname_github_app %} read and write permissions to organization projects. For more information, see "[AUTOTITLE](/apps/maintaining-github-apps/editing-a-github-apps-permissions)." +2. Give your {% data variables.product.prodname_github_app %} read and write permissions to organization projects. For this specific example, your {% data variables.product.prodname_github_app %} will also need read permissions to repository pull requests and repository issues. For more information, see "[AUTOTITLE](/apps/maintaining-github-apps/editing-a-github-apps-permissions)." {% note %} @@ -49,7 +49,7 @@ For more information about authenticating in a {% data variables.product.prodnam 3. Install the {% data variables.product.prodname_github_app %} in your organization. Install it for all repositories that your project needs to access. For more information, see "[AUTOTITLE](/apps/maintaining-github-apps/installing-github-apps#installing-your-private-github-app-on-your-repository)." 4. Store your {% data variables.product.prodname_github_app %}'s ID as a secret in your repository or organization. In the following workflow, replace `APP_ID` with the name of the secret. You can find your app ID on the settings page for your app or through the App API. For more information, see "[AUTOTITLE](/rest/apps#get-an-app)." 5. Generate a private key for your app. Store the contents of the resulting file as a secret in your repository or organization. (Store the entire contents of the file, including `-----BEGIN RSA PRIVATE KEY-----` and `-----END RSA PRIVATE KEY-----`.) In the following workflow, replace `APP_PEM` with the name of the secret. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps)." -6. In the following workflow, replace `YOUR_ORGANIZATION` with the name of your organization. For example, `octo-org`. Replace `YOUR_PROJECT_NUMBER` with your project number. To find the project number, look at the project URL. For example, `https://github.com/orgs/octo-org/projects/5` has a project number of 5. +6. In the following workflow, replace `YOUR_ORGANIZATION` with the name of your organization. For example, `octo-org`. Replace `YOUR_PROJECT_NUMBER` with your project number. To find the project number, look at the project URL. For example, `https://github.com/orgs/octo-org/projects/5` has a project number of 5. In order for this specific example to work, your project must also have a "Date posted" date field. ```yaml{:copy} {% data reusables.actions.actions-not-certified-by-github-comment %} From 3583c8bcf61363f9b867da10b12710f732e6c6c3 Mon Sep 17 00:00:00 2001 From: Rachael Sewell Date: Wed, 10 May 2023 16:20:12 -0700 Subject: [PATCH 2/2] Fixes unsupported GHES 3.9 releases from being added (#37024) --- src/rest/scripts/utils/sync.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/rest/scripts/utils/sync.js b/src/rest/scripts/utils/sync.js index 3e12e11bf7..efc2f91460 100644 --- a/src/rest/scripts/utils/sync.js +++ b/src/rest/scripts/utils/sync.js @@ -138,29 +138,37 @@ export async function getOpenApiSchemaFiles(schemas) { // The full list of dereferened OpenAPI schemas received from // bundling the OpenAPI in github/github const schemaNames = schemas.map((schema) => path.basename(schema, '.json')) + const OPENAPI_VERSION_NAMES = Object.keys(allVersions).map( (elem) => allVersions[elem].openApiVersionName ) + for (const schema of schemaNames) { const schemaBasename = `${schema}.json` - // catches all of the schemas that are not - // calendar date versioned. Ex: ghec, ghes-3.7, and api.github.com + // If the version doesn't have calendar date versioning + // it should have an exact match with one of the versions defined + // in the allVersions object. if (OPENAPI_VERSION_NAMES.includes(schema)) { webhookSchemas.push(schemaBasename) - // Non-calendar date schemas could also match the calendar date versioned - // counterpart. + } + + // If the schema version has calendar date versioning, then one of + // the versions defined in allVersions should be a substring of the + // schema version. This means the schema version is a supported version + if (OPENAPI_VERSION_NAMES.some((elem) => schema.startsWith(elem))) { + // If the schema being evaluated is a calendar-date version, then + // there would only be one exact match in the list of schema names. + // If the schema being evaluated is a non-calendar-date version, then + // there will be two matches. // Ex: api.github.com would match api.github.com and // api.github.com.2022-09-09 const filteredMatches = schemaNames.filter((elem) => elem.includes(schema)) - // If there is only one match then there are no calendar date counterparts - // and this is the only schema for this plan and release. + // If there is only one match then it's either a calendar-date version + // or the version doesn't support calendar dates yet. We favor calendar-date + // versions but default to non calendar-date versions. if (filteredMatches.length === 1) { restSchemas.push(schemaBasename) } - // catches all of the calendar date versioned schemas in the - // format api.github.com.-- - } else { - restSchemas.push(schemaBasename) } } return { restSchemas, webhookSchemas }