From 22595cf38d9bcd87570357b4c15b266df283e99e Mon Sep 17 00:00:00 2001 From: galargh Date: Sun, 9 Aug 2026 16:04:08 +0000 Subject: [PATCH] upgrade@31322799981 --- .github/workflows/fix.yml | 8 ++++---- scripts/__tests__/workflows.test.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fix.yml b/.github/workflows/fix.yml index dba81be..50248cd 100644 --- a/.github/workflows/fix.yml +++ b/.github/workflows/fix.yml @@ -133,7 +133,7 @@ jobs: - name: Upload YAML config uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: ${{ env.TF_WORKSPACE }}.yml + name: fixed-config-${{ env.TF_WORKSPACE }} path: github/${{ env.TF_WORKSPACE }}.yml if-no-files-found: error retention-days: 1 @@ -177,10 +177,10 @@ jobs: uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: path: artifacts + pattern: fixed-config-* + merge-multiple: true - name: Copy YAML configs - run: | - shopt -s globstar - cp artifacts/**/*.yml head/github + run: cp artifacts/*.yml head/github - name: Check if github was modified id: github-modified run: | diff --git a/scripts/__tests__/workflows.test.ts b/scripts/__tests__/workflows.test.ts index fb19575..993d53e 100644 --- a/scripts/__tests__/workflows.test.ts +++ b/scripts/__tests__/workflows.test.ts @@ -7,6 +7,7 @@ type WorkflowStep = { name?: string run?: string env?: Record + with?: Record } type Workflow = { @@ -58,4 +59,30 @@ describe('workflows', () => { assert.ok(steps.includes('Publish access report summary')) assert.ok(steps.includes('Upload access report')) }) + + it('downloads only fixed YAML config artifacts before pushing fix changes', () => { + const fix = workflow('fix.yml') + const fixSteps = fix.jobs.fix.steps + const pushSteps = fix.jobs.push.steps + const uploadYamlStep = fixSteps.find( + step => step.name === 'Upload YAML config' + ) + const downloadYamlStep = pushSteps.find( + step => step.name === 'Download YAML configs' + ) + const copyYamlStep = pushSteps.find( + step => step.name === 'Copy YAML configs' + ) + + assert.ok(uploadYamlStep) + assert.ok(downloadYamlStep) + assert.ok(copyYamlStep) + assert.equal( + uploadYamlStep.with?.name, + 'fixed-config-${{ env.TF_WORKSPACE }}' + ) + assert.equal(downloadYamlStep.with?.pattern, 'fixed-config-*') + assert.equal(downloadYamlStep.with?.['merge-multiple'], true) + assert.equal(copyYamlStep.run, 'cp artifacts/*.yml head/github') + }) })