From 063b191d021965f430468838027a636b5cf1cc98 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Fri, 12 Jun 2026 15:07:31 -0700 Subject: [PATCH 1/3] updated node version Signed-off-by: ruokun-niu --- .github/workflows/automerge.yml | 2 +- .github/workflows/build-tutorial-images.yml | 4 ++-- .github/workflows/manual-build-images.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tutorial-evaluation-scheduled.yml | 6 +++--- .github/workflows/tutorial-evaluation.yml | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 6c8b6bb..02457be 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Automerge PRs uses: actions/github-script@v7 diff --git a/.github/workflows/build-tutorial-images.yml b/.github/workflows/build-tutorial-images.yml index 213dc8c..3e8529b 100644 --- a/.github/workflows/build-tutorial-images.yml +++ b/.github/workflows/build-tutorial-images.yml @@ -39,7 +39,7 @@ jobs: building-changed: ${{ steps.changes.outputs.building }} tutorials: ${{ steps.set-matrix.outputs.tutorials }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dorny/paths-filter@v2 id: changes @@ -87,7 +87,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/manual-build-images.yml b/.github/workflows/manual-build-images.yml index 5e2c3d6..32313a7 100644 --- a/.github/workflows/manual-build-images.yml +++ b/.github/workflows/manual-build-images.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 987c1e8..0adb25c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Zip tutorial folder run: | diff --git a/.github/workflows/tutorial-evaluation-scheduled.yml b/.github/workflows/tutorial-evaluation-scheduled.yml index 097f2c6..fc4bde5 100644 --- a/.github/workflows/tutorial-evaluation-scheduled.yml +++ b/.github/workflows/tutorial-evaluation-scheduled.yml @@ -39,12 +39,12 @@ jobs: steps: - name: Checkout this repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Checkout docs repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: drasi-project/docs ref: main @@ -207,7 +207,7 @@ jobs: fi - name: Upload evaluation results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 if: always() with: name: evaluation-results-${{ matrix.tutorial }}-${{ github.event.pull_request.number || github.run_id }} diff --git a/.github/workflows/tutorial-evaluation.yml b/.github/workflows/tutorial-evaluation.yml index 88daada..48ac22d 100644 --- a/.github/workflows/tutorial-evaluation.yml +++ b/.github/workflows/tutorial-evaluation.yml @@ -82,10 +82,10 @@ jobs: environment: tutorial-evaluation steps: - name: Checkout this repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Checkout docs repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: drasi-project/docs ref: ${{ inputs.docs_repo_branch }} @@ -158,7 +158,7 @@ jobs: fi - name: Upload evaluation results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 if: always() with: name: evaluation-results-${{ inputs.tutorial }} From 3c7adc55010df07ae672825febd48958940260e2 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Fri, 12 Jun 2026 15:17:51 -0700 Subject: [PATCH 2/3] scorecard and devskim Signed-off-by: ruokun-niu --- .github/workflows/automerge.yml | 97 --------------------------------- .github/workflows/devskim.yml | 21 +++++++ .github/workflows/scorecard.yml | 62 +++++++++++++++++++++ renovate.json | 37 ------------- 4 files changed, 83 insertions(+), 134 deletions(-) delete mode 100644 .github/workflows/automerge.yml create mode 100644 .github/workflows/devskim.yml create mode 100644 .github/workflows/scorecard.yml delete mode 100644 renovate.json diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 02457be..0000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: Automerge Renovate PRs - -on: - schedule: - # Disable AutoRun for now: Runs at 12:00 PM Pacific Time on Wednesdays. - # - cron: '0 19 * * 3' - workflow_dispatch: # Allows manual triggering - -permissions: - contents: read - pull-requests: write - -jobs: - automerge: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v5 - - - name: Automerge PRs - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const owner = context.repo.owner; - const repo = context.repo.repo; - const now = new Date(); - - async function processPRs(label, daysToWait, mergeMethod = 'squash') { - console.log(`\n--- Processing PRs with label: ${label}, waiting ${daysToWait} days ---`); - const { data: prs } = await github.rest.pulls.list({ - owner, - repo, - state: 'open', - per_page: 10, - }); - - let foundPrsWithLabel = 0; - - for (const pr of prs) { - if (!pr.labels.find(l => l.name === label)) { - continue; - } - foundPrsWithLabel++; - console.log(`\nProcessing PR #${pr.number} ('${pr.title}')`); - - const createdAt = new Date(pr.created_at); - const ageInMilliseconds = now - createdAt; - const requiredAgeInMilliseconds = daysToWait * 24 * 60 * 60 * 1000; - - if (ageInMilliseconds < requiredAgeInMilliseconds) { - const ageHours = Math.floor(ageInMilliseconds / (1000 * 60 * 60)); - const requiredHours = daysToWait * 24; - console.log(` PR #${pr.number} is too new. Age: ${ageHours} hours. Required: ${requiredHours} hours (${daysToWait} days).`); - continue; - } - console.log(` PR #${pr.number} is old enough.`); - - // Check CI status using combined status for the PR's head commit - const { data: status } = await github.rest.repos.getCombinedStatusForRef({ - owner, - repo, - ref: pr.head.sha, - }); - - if (status.state !== 'success') { - console.log(` PR #${pr.number} CI status is '${status.state}' (not 'success'). Skipping merge.`); - continue; - } - console.log(` PR #${pr.number} CI status is 'success'.`); - - // Attempt to merge - try { - console.log(` Attempting to merge PR #${pr.number} with method '${mergeMethod}'...`); - await github.rest.pulls.merge({ - owner, - repo, - pull_number: pr.number, - merge_method: mergeMethod, - }); - console.log(` Successfully merged PR #${pr.number}.`); - } catch (error) { - console.error(` Failed to merge PR #${pr.number}: ${error.message}`); - if (error.response && error.response.data) { - console.error(` Error details: ${JSON.stringify(error.response.data, null, 2)}`); - } - } - } - if (foundPrsWithLabel === 0) { - console.log(`No open PRs found with label '${label}'.`); - } - } - - console.log("Starting automerge workflow..."); - await processPRs("automerge-patch-candidate", 7, 'squash'); // Patches wait 7 days - await processPRs("automerge-minor-candidate", 14, 'squash'); // Minors wait 14 days - console.log("Automerge workflow finished."); diff --git a/.github/workflows/devskim.yml b/.github/workflows/devskim.yml new file mode 100644 index 0000000..0527547 --- /dev/null +++ b/.github/workflows/devskim.yml @@ -0,0 +1,21 @@ +name: DevSkim + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '30 0 * * 0' + workflow_dispatch: + +permissions: + contents: read + +jobs: + devskim: + permissions: + actions: read + contents: read + security-events: write + uses: drasi-project/.github/.github/workflows/devskim.yaml@main diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..dc52f1e --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,62 @@ +# Copyright 2024 The Drasi Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Scorecard supply-chain security +on: + branch_protection_rule: + schedule: + - cron: '15 15 * * 1' + push: + branches: [ "main" ] + +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + if: github.repository == 'drasi-project/learning' + + permissions: + security-events: write + id-token: write + contents: read + actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + + - name: "Upload artifact" + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard (optional). + # Commenting out will disable upload of results to your repo's Code Scanning dashboard + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 + with: + sarif_file: results.sarif diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 686ec9d..0000000 --- a/renovate.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ], - "prConcurrentLimit": 10, - "dependencyDashboard": true, - "vulnerabilityAlerts": { - "enabled": true, - "labels": ["security", "vulnerability"] - }, - "packageRules": [ - { - "description": "Group stable patch updates for potential automerge", - "matchUpdateTypes": ["patch"], - "minimumReleaseAge": "30 days", - "automerge": false, - "platformAutomerge": false, - "addLabels": ["automerge-patch-candidate"], - "groupName": "Safe Patch Updates" - }, - { - "description": "Group stable minor updates for potential automerge", - "matchUpdateTypes": ["minor"], - "minimumReleaseAge": "60 days", - "automerge": false, - "platformAutomerge": false, - "addLabels": ["automerge-minor-candidate"], - "groupName": "Safe Minor Updates" - }, - { - "description": "Require dashboard approval for major updates, create separate PRs", - "matchUpdateTypes": ["major"], - "dependencyDashboardApproval": true - } - ] -} From 051e17fcac44f7346a0af407c1c9ef1e27a29250 Mon Sep 17 00:00:00 2001 From: ruokun-niu Date: Tue, 16 Jun 2026 14:45:16 -0700 Subject: [PATCH 3/3] copilt comments Signed-off-by: ruokun-niu --- .github/workflows/build-tutorial-images.yml | 4 ++-- .github/workflows/manual-build-images.yml | 2 +- .github/workflows/tutorial-evaluation-scheduled.yml | 6 +++--- .github/workflows/tutorial-evaluation.yml | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-tutorial-images.yml b/.github/workflows/build-tutorial-images.yml index 3e8529b..6f44861 100644 --- a/.github/workflows/build-tutorial-images.yml +++ b/.github/workflows/build-tutorial-images.yml @@ -39,7 +39,7 @@ jobs: building-changed: ${{ steps.changes.outputs.building }} tutorials: ${{ steps.set-matrix.outputs.tutorials }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: dorny/paths-filter@v2 id: changes @@ -87,7 +87,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/manual-build-images.yml b/.github/workflows/manual-build-images.yml index 32313a7..3688add 100644 --- a/.github/workflows/manual-build-images.yml +++ b/.github/workflows/manual-build-images.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/tutorial-evaluation-scheduled.yml b/.github/workflows/tutorial-evaluation-scheduled.yml index fc4bde5..45f1374 100644 --- a/.github/workflows/tutorial-evaluation-scheduled.yml +++ b/.github/workflows/tutorial-evaluation-scheduled.yml @@ -39,12 +39,12 @@ jobs: steps: - name: Checkout this repo - uses: actions/checkout@v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Checkout docs repo - uses: actions/checkout@v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: repository: drasi-project/docs ref: main @@ -207,7 +207,7 @@ jobs: fi - name: Upload evaluation results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 if: always() with: name: evaluation-results-${{ matrix.tutorial }}-${{ github.event.pull_request.number || github.run_id }} diff --git a/.github/workflows/tutorial-evaluation.yml b/.github/workflows/tutorial-evaluation.yml index 48ac22d..eaf2fd1 100644 --- a/.github/workflows/tutorial-evaluation.yml +++ b/.github/workflows/tutorial-evaluation.yml @@ -82,10 +82,10 @@ jobs: environment: tutorial-evaluation steps: - name: Checkout this repo - uses: actions/checkout@v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Checkout docs repo - uses: actions/checkout@v5 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: repository: drasi-project/docs ref: ${{ inputs.docs_repo_branch }} @@ -158,7 +158,7 @@ jobs: fi - name: Upload evaluation results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 if: always() with: name: evaluation-results-${{ inputs.tutorial }}