Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release Scripts] Fix changelog formatting and bump checkout/setup-node github action versions #2052

Merged
merged 6 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:

steps:
# See nx recipe: https://nx.dev/recipes/ci/monorepo-ci-github-actions
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0 # nx recipe

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -54,13 +54,13 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0 # nx recipe

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -93,13 +93,13 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0 # nx recipe

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -145,12 +145,12 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for computing changelog
fetch-tags: true
Expand Down
12 changes: 7 additions & 5 deletions scripts/github-action/create-github-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ async function getPRsBetweenCommits(github, context, core, lastCommit, currentCo

return prsMerged.search.nodes.map((pr) => ({
number: `[#${pr.number}](${pr.url})`,
title: pr.title,
// escape the pipe character in the title to avoid table formatting issues
title: pr.title.replace('|', '\\|'),
url: pr.url,
files: pr.files.nodes.map((file) => file.path),
author: `@${pr.author.login}`,
Expand Down Expand Up @@ -200,15 +201,15 @@ function formatChangeLog(prs, tagsContext, context) {

const changelog = `
# What's New

https://github.com/${context.repo.owner}/${context.repo.repo}/compare/${releaseDiff}

## Packages Published

${formattedPackageTags || 'No packages published'}

${internalPRS.length > 0 ? formatTable(internalPRS, tableConfig, '## Internal PRs') : ''}

${externalPRs.length > 0 ? formatTable(externalPRs, tableConfig, '## External PRs') : ''}
`
// trim double spaces and return the changelog
Expand All @@ -225,8 +226,9 @@ function formatTable(prs, tableConfig, title = '') {
${prs.map((pr) => `|${tableConfig.map((config) => pr[config.value]).join('|')}|`).join('\n')}
`
}

// Map PRs with affected destinations based on the files changed
/*
* Map PR with affected destinations
*/
function mapPRWithAffectedDestinations(pr) {
let affectedDestinations = []
if (pr.labels.includes('mode:cloud')) {
Expand Down
Loading