The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
DANGEROUSLY allow patches on red commits (#58260)
Ryan Lauried3b69c4c860f
diff --git a/.github/workflows/release-patch.yml b/.github/workflows/release-patch.ymlindex 225b724e57b..a8f5cf842fb 100644--- a/.github/workflows/release-patch.yml+++ b/.github/workflows/release-patch.yml@@ -8,6 +8,11 @@ on:description: 'Major Metabase version (e.g. 45, 52, 68)'type: numberrequired: true+ override_sha:+ description: DANGEROUSLY allow releasing from this commit sha, regardless of the state of CI (can be empty)+ type: string+ required: false+ default: ''schedule:- cron: '0 21 * * 1-5' # every weekday at 4 pm EST/5 pm EDT@@ -45,36 +50,46 @@ jobs:majorVersion,});- const goodCommit = await getLatestGreenCommit({- github,- owner: context.repo.owner,- repo: context.repo.repo,- branch: `release-x.${majorVersion}.x`,- });+ // only allow overriding the commit SHA for workflow_dispatch events with a provided sha+ const overrideSha = String(context.payload.inputs.override_sha ?? '').trim();+ const isValidOverride = context.eventName === 'workflow_dispatch' && overrideSha.length === 40;++ if (!isValidOverride && overrideSha.length > 0) {+ throw new Error(`Invalid override SHA provided: ${overrideSha}`);+ }++ const releaseCommit = isValidOverride+ ? overrideSha+ : await getLatestGreenCommit({+ github,+ owner: context.repo.owner,+ repo: context.repo.repo,+ branch: `release-x.${majorVersion}.x`,+ });const hasBeenReleased = await hasCommitBeenReleased({github,owner: context.repo.owner,repo: context.repo.repo,- ref: goodCommit,+ ref: releaseCommit,majorVersion: Number(majorVersion),});- if (nextPatch && goodCommit && !hasBeenReleased) {+ if (nextPatch && releaseCommit && !hasBeenReleased) {await github.rest.actions.createWorkflowDispatch({owner: context.repo.owner,repo: context.repo.repo,workflow_id: 'tag-for-release.yml',ref: 'refs/heads/master',inputs: {- commit: goodCommit,+ commit: releaseCommit,version: nextPatch,auto: true,}});} else {console.log(- { nextPatch, goodCommit, hasBeenReleased }+ { nextPatch, releaseCommit, hasBeenReleased });console.error(`No new patch version or no green commit found for v${majorVersion}`);}