From 4e23c3f9dfd56a116aeeafdf4df1cad19e7df49b Mon Sep 17 00:00:00 2001 From: John White <750350+johnhwhite@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:21:01 -0500 Subject: [PATCH] build: create 11.x.x LTS branch --- .github/workflows/cherry-pick.yml | 25 +++++++++++++++---------- .github/workflows/ci.yml | 2 +- .github/workflows/release-please.yml | 2 +- .skyuxdev.json | 2 +- nx.json | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cherry-pick.yml b/.github/workflows/cherry-pick.yml index 4039456b..0ee80403 100644 --- a/.github/workflows/cherry-pick.yml +++ b/.github/workflows/cherry-pick.yml @@ -4,7 +4,7 @@ on: types: - closed branches: - - 8.x.x + - '[0-9]+.x.x' env: TARGET_BRANCH: main @@ -15,20 +15,20 @@ jobs: if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ env.TARGET_BRANCH }} fetch-depth: 0 token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 id: setup-node with: node-version-file: '.nvmrc' - name: Cache node modules id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-node-${{ steps.setup-node.outputs.node-version }}-modules-${{ hashFiles('package-lock.json') }} @@ -38,9 +38,11 @@ jobs: run: npm ci - name: Cherry pick + id: cherry-pick run: | - git config user.name 'Blackbaud Sky Build User' - git config user.email 'sky-build-user@blackbaud.com' + # Set the git user to the author of the merge commit. + git config user.name "$(git log -1 --pretty=format:'%an' ${{ github.event.pull_request.merge_commit_sha }})" + git config user.email "$(git log -1 --pretty=format:'%ae' ${{ github.event.pull_request.merge_commit_sha }})" # Echo commands to the log. set -x @@ -71,15 +73,18 @@ jobs: echo "CHERRY_PICK_RESULT=failed" >> $GITHUB_ENV exit 0 fi + + echo "commit_message=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT env: GH_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 if: ${{ env.CHERRY_PICK_RESULT != 'failed' }} with: github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} script: | const pr = context.payload.pull_request; + const title = ${{ toJson(steps.cherry-pick.outputs.commit_message) }}; let body = `:cherries: Cherry picked from #${pr.number} [${pr.title}](${pr.html_url})` const prAzureBoardLink = pr.body?.match(/(?<=\[)AB#\d+(?=])/g); if (prAzureBoardLink) { @@ -90,7 +95,7 @@ jobs: repo: context.repo.repo, head: process.env.CHERRY_PICK_BRANCH, base: process.env.TARGET_BRANCH, - title: `${pr.title} (#${pr.number})`, + title, body }).then(result => { console.log(`Created PR #${result.data.number}: ${result.data.html_url}`); @@ -120,7 +125,7 @@ jobs: - name: Comment on the original PR when cherry-pick is successful if: ${{ env.CHERRY_PICK_RESULT == 'success' }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} script: | @@ -133,7 +138,7 @@ jobs: - name: Comment on the original PR when cherry-pick fails if: ${{ env.CHERRY_PICK_RESULT != 'success' }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} script: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ab99feb..fc3e91bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - main + - 11.x.x pull_request: env: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6bdd4759..0e4b47bb 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: push: branches: - - main + - 11.x.x env: # Set to 'alpha', 'beta', or 'rc' to create a prerelease. PRERELEASE: 'false' diff --git a/.skyuxdev.json b/.skyuxdev.json index 37a4f3ad..aedeeccb 100644 --- a/.skyuxdev.json +++ b/.skyuxdev.json @@ -1,5 +1,5 @@ { - "baseBranch": "main", + "baseBranch": "11.x.x", "documentationExcludeProjects": [ "clipboard", "code-block", diff --git a/nx.json b/nx.json index 99206d14..a2e8228d 100644 --- a/nx.json +++ b/nx.json @@ -1,7 +1,7 @@ { "$schema": "./node_modules/nx/schemas/nx-schema.json", "affected": { - "defaultBase": "main" + "defaultBase": "11.x.x" }, "tasksRunnerOptions": { "default": {