From 4bbe5e1f63fa9e2a8b01d9a90ca6f69b193dc2c4 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Sat, 25 Jul 2026 17:04:45 -0400 Subject: [PATCH] Publish regenerated standard via a pull request The update-standard workflow regenerates standard/*.json every month and runs the test suite against it, but the step that lands the result was commented out because it committed directly to master. The workflow has therefore succeeded every month while discarding its own output, and the published JSON has not changed since rev2024b (2024-04-18). Replace the disabled publish step with peter-evans/create-pull-request so the regenerated data is proposed for review instead of pushed. This keeps the safety property that caused the original step to be disabled - nothing reaches master unreviewed - while allowing updates to land again. Also drop continue-on-error from the test job. It caused the workflow to report success even when a step failed, which hid the state this issue was reported about. Fixes #116 --- .github/workflows/update-standard.yml | 33 +++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update-standard.yml b/.github/workflows/update-standard.yml index 466c674..59591ea 100644 --- a/.github/workflows/update-standard.yml +++ b/.github/workflows/update-standard.yml @@ -35,11 +35,13 @@ jobs: with: name: new_standard path: dicom_standard/dist/* - test-and-commit: + test-and-open-pr: needs: make - name: Run tox and commit to master + name: Run tox and open a pull request runs-on: ubuntu-latest - continue-on-error: true + permissions: + contents: write + pull-requests: write steps: - uses: actions/checkout@v4 - name: Set up Python ${{ env.PYTHON_VERSION }} @@ -66,9 +68,22 @@ jobs: if: steps.diff_files.outputs.diff_lines > 0 - name: Run tests run: tox - # temporary disable "publish to master", which may commit the changes in an unapproved PR - # - name: Publish to master - # uses: mikeal/publish-to-github-action@master - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # if: success() && steps.diff_files.outputs.diff_lines > 0 + # Publish via a pull request rather than by committing straight to master, so + # regenerated data is reviewed before it lands. Runs only after tox has passed. + - name: Open pull request + if: steps.diff_files.outputs.diff_lines > 0 + uses: peter-evans/create-pull-request@v8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: master + branch: update-standard/${{ env.DICOM_VERSION }} + delete-branch: true + add-paths: standard/*.json + commit-message: 'Update standard to latest published revision' + title: 'Update standard (DICOM ${{ env.DICOM_VERSION }})' + body: | + Automated regeneration of `standard/*.json` from the current published + DICOM Standard, opened by the `update-standard` workflow. + + The test suite (`tox`) passed against this data before the pull request + was created. Review the diff and merge to publish.