From 22eab2be4dfa503a7e7fde96649af3de71f9d924 Mon Sep 17 00:00:00 2001 From: "Charlton, Scott R." Date: Sun, 6 Jul 2025 13:08:57 -0600 Subject: [PATCH] Add workflows for linting and syncing subtrees, and update subtrees.json format --- examples/c/.github/subtrees.json | 1 + .../c/.github/workflows/lint-subtrees.yml | 19 +++++++++++ examples/c/.github/workflows/subtree.yml | 33 +++++++++++++++++++ src/phreeqcpp/.github/subtrees.json | 3 +- 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 examples/c/.github/subtrees.json create mode 100644 examples/c/.github/workflows/lint-subtrees.yml create mode 100644 examples/c/.github/workflows/subtree.yml diff --git a/examples/c/.github/subtrees.json b/examples/c/.github/subtrees.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/examples/c/.github/subtrees.json @@ -0,0 +1 @@ +[] diff --git a/examples/c/.github/workflows/lint-subtrees.yml b/examples/c/.github/workflows/lint-subtrees.yml new file mode 100644 index 00000000..60661485 --- /dev/null +++ b/examples/c/.github/workflows/lint-subtrees.yml @@ -0,0 +1,19 @@ +name: Lint subtrees.json + +on: + pull_request: + paths: + - '.github/subtrees.json' + workflow_call: + workflow_dispatch: + +jobs: + lint-subtrees: + runs-on: ubuntu-latest + env: + CI_SERVER_HOST: github.com + GROUP: usgs-coupled + steps: + - uses: usgs-coupled/sync-subtrees-action/lint-subtrees/@main + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/examples/c/.github/workflows/subtree.yml b/examples/c/.github/workflows/subtree.yml new file mode 100644 index 00000000..6dda6cf6 --- /dev/null +++ b/examples/c/.github/workflows/subtree.yml @@ -0,0 +1,33 @@ +name: Sync Subtrees + +on: + workflow_dispatch: + inputs: + dryRun: + description: 'If true, don’t push any changes (for testing only).' + required: true + default: true + type: boolean + testMerge: + description: 'Run in test mode, pushing to a test branch.' + required: true + default: false + type: boolean + +jobs: + sync-subtrees: + runs-on: ubuntu-latest + env: + CI_SERVER_HOST: github.com + GROUP: usgs-coupled + GH_TOKEN: ${{ secrets.WORKFLOW_PAT }} + steps: + - name: Run sync-subtrees-action + uses: usgs-coupled/sync-subtrees-action@main + with: + dryRun: ${{ inputs.dryRun }} + testMerge: ${{ inputs.testMerge }} + repository_name: ${{ github.event.repository.name }} + default_branch: ${{ github.event.repository.default_branch }} + run_number: ${{ github.run_number }} + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} diff --git a/src/phreeqcpp/.github/subtrees.json b/src/phreeqcpp/.github/subtrees.json index 7f076eb3..ff31b0dd 100644 --- a/src/phreeqcpp/.github/subtrees.json +++ b/src/phreeqcpp/.github/subtrees.json @@ -1,6 +1,7 @@ [ { "prefix": "common", - "url": "git@${CI_SERVER_HOST}:${GROUP}-subtrees/phreeqc3-src-common.git" + "url": "git@${CI_SERVER_HOST}:${GROUP}-subtrees/phreeqc3-src-common.git", + "repo": "usgs-coupled-subtrees/phreeqc3-src-common" } ] \ No newline at end of file