Skip to content

Commit 7c7ec90

Browse files
authored
Create ghes release features (github#36718)
1 parent 2876eda commit 7c7ec90

32 files changed

+116
-175
lines changed

.github/actions-scripts/create-enterprise-issue.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path'
55
import { getOctokit } from '@actions/github'
66
import { latest, oldestSupported } from '../../lib/enterprise-server-releases.js'
77
const enterpriseDates = JSON.parse(
8-
await fs.readFile(path.join(process.cwd(), 'lib/enterprise-dates.json'))
8+
await fs.readFile(path.join(process.cwd(), 'src/ghes-releases/lib/enterprise-dates.json'))
99
)
1010

1111
const acceptedMilestones = ['release', 'deprecation']
@@ -23,7 +23,8 @@ const numberOfdaysBeforeDeprecationToOpenIssue = 15
2323
//
2424
// When a milestone is within the specified number of days, a new issue is
2525
// created using the templates in
26-
// .github/actions-scripts/enterprise-server-issue-templates.
26+
// src/ghes-releases/lib/release-steps.md
27+
// and src/ghes-releases/lib/deprecation-steps.md.
2728
//
2829
// Release issues are then added to the docs content squad board for triage.
2930
// Deprecations issues are owned by docs engineering and are added to the
@@ -53,7 +54,7 @@ async function run() {
5354

5455
if (!versionNumber) {
5556
console.log(
56-
`Could not find the next version number after ${latest} in enterprise-dates.json. Try running script/update-enterprise-dates.js, then rerun this script.`
57+
`Could not find the next version number after ${latest} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.`
5758
)
5859
process.exit(0)
5960
}
@@ -62,7 +63,7 @@ async function run() {
6263

6364
if (!datesForVersion) {
6465
console.log(
65-
`Could not find ${versionNumber} in enterprise-dates.json. Try running script/update-enterprise-dates.js, then rerun this script.`
66+
`Could not find ${versionNumber} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.`
6667
)
6768
process.exit(0)
6869
}
@@ -79,10 +80,7 @@ async function run() {
7980
}
8081

8182
const milestoneSteps = await fs.readFile(
82-
path.join(
83-
process.cwd(),
84-
`.github/actions-scripts/enterprise-server-issue-templates/${milestone}-issue.md`
85-
),
83+
path.join(process.cwd(), `src/ghes-releases/lib/${milestone}-steps.md`),
8684
'utf8'
8785
)
8886
const issueLabels =

.github/workflows/enterprise-dates.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Enterprise date updater
22

3-
# **What it does**: Runs on a schedule to update lib/enterprise-dates.json.
4-
# **Why we have it**: The lib/enterprise-dates.json file needs to be up-to-date
5-
# for the .github/workflows/open-enterprise-issue.yml workflow and the
3+
# **What it does**: Runs on a schedule to update
4+
# src/ghes-releases/lib/enterprise-dates.json.
5+
# **Why we have it**: The src/ghes-releases/lib/enterprise-dates.json
6+
# file needs to be up-to-date for the
7+
# .github/workflows/open-enterprise-issue.yml workflow and the
68
# tests/content/search.js test.
79
# **Who does it impact**: Docs engineering, docs content.
810

@@ -40,9 +42,9 @@ jobs:
4042

4143
- uses: ./.github/actions/node-npm-setup
4244

43-
- name: Run script/update-enterprise-dates.js
45+
- name: Run src/ghes-releases/scripts/update-enterprise-dates.js
4446
run: |
45-
script/update-enterprise-dates.js
47+
src/ghes-releases/scripts/update-enterprise-dates.js
4648
env:
4749
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_FR }}
4850

@@ -55,8 +57,8 @@ jobs:
5557
with:
5658
# need to use a token with repo and workflow scopes for this step
5759
token: ${{ secrets.GITHUB_TOKEN }}
58-
commit-message: '🤖 ran script/update-enterprise-dates.js'
59-
title: 🤖 lib/enterprise-dates.json update
60+
commit-message: '🤖 ran src/ghes-releases/scripts/update-enterprise-dates.js'
61+
title: 🤖 src/ghes-releases/lib/enterprise-dates.json update
6062
body:
6163
"Hello! The GitHub Enterprise Server release dates have changed.\n\n
6264
If CI passes, this PR will be auto-merged. :green_heart:\n\n

.github/workflows/open-enterprise-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Update enterprise dates
3434
if: steps.existingIssue.outputs.deprecationIssue == 'false' || steps.existingIssue.outputs.releaseIssue == 'false'
3535
run: |
36-
script/update-enterprise-dates.js
36+
src/ghes-releases/scripts/update-enterprise-dates.js
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_FR }}
3939

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
{ name: 'content', path: 'tests/content', },
4343
{ name: 'automated-pipelines', path: 'src/automated-pipelines/tests', },
4444
{ name: 'events', path: 'src/events/tests', },
45+
{ name: 'ghes-releases', path: 'src/ghes-releases/tests', },
4546
{ name: 'graphql', path: 'src/graphql/tests', },
4647
{ name: 'rest', path: 'src/rest/tests', },
4748
{ name: 'webhooks', path: 'src/webhooks/tests', },

data/release-notes/enterprise-server/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Rendered here: https://docs.github.com/en/enterprise-server@latest/admin/release
44

55
## Adding release notes to a deprecated GitHub Enterprise Server release
66

7-
During the deprecation of a GitHub Enterprise Server release per [this issue template](/.github/actions-scripts/enterprise-server-issue-templates/deprecation-issue.md), Docs Engineering removes the YAML files with the version's release notes from `github/docs-internal`.
7+
During the deprecation of a GitHub Enterprise Server release per [this issue template](/src/ghes-releases/lib/deprecation-steps.md), Docs Engineering removes the YAML files with the version's release notes from `github/docs-internal`.
88

99
If a stakeholder requests an update to deprecated release notes, you can update the notes by completing the following steps.
1010

1111
1. Check out the long-running branch <code>enterprise-<em>VERSION</em>-release</code> and create a PR to update the release notes for the deprecated version on that branch.
12-
2. Reach out to #docs-engineering to request a re-scrape and update of the content stored in Azure. See the section about re-scraping content in the [deprecation checklist](/.github/actions-scripts/enterprise-server-issue-templates/deprecation-issue.md).
12+
2. Reach out to #docs-engineering to request a re-scrape and update of the content stored in Azure. See the section about re-scraping content in the [deprecation checklist](/src/ghes-releases/lib/deprecation-steps.md).
1313

1414
## How it works
1515

lib/enterprise-server-releases.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import path from 'path'
21
import fs from 'fs/promises'
32
import semver from 'semver'
43

54
import versionSatisfiesRange from './version-satisfies-range.js'
65

7-
export const dates = JSON.parse(
8-
await fs.readFile(path.join(process.cwd(), './lib/enterprise-dates.json'))
9-
)
6+
export const dates = JSON.parse(await fs.readFile('src/ghes-releases/lib/enterprise-dates.json'))
107

118
// GHES Release Lifecycle Dates:
129
// enterprise-releases/docs/supported-versions.md#release-lifecycle-dates

package-lock.json

Lines changed: 27 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@
162162
"start-server-and-test": "^2.0.0",
163163
"typescript": "^5.0.2",
164164
"unist-util-remove": "^3.1.1",
165-
"unist-util-visit-parents": "^5.1.3"
165+
"unist-util-visit-parents": "^5.1.3",
166+
"website-scraper": "^5.3.1"
166167
},
167168
"engines": {
168169
"node": "^16 || ^18"
@@ -174,7 +175,7 @@
174175
"esm": "^3.2.25",
175176
"jest-puppeteer": "^5.0.4",
176177
"puppeteer": "^9.1.1",
177-
"website-scraper": "^5.0.0"
178+
"website-scraper": "^5.3.1"
178179
},
179180
"private": true,
180181
"repository": "https://github.com/github/docs",

0 commit comments

Comments
 (0)