Add workflows for linting and syncing subtrees.json

This commit is contained in:
Charlton, Scott R 2025-06-28 16:34:48 -06:00
parent 311bc42e32
commit 9592f20922
3 changed files with 60 additions and 0 deletions

6
phreeqcpp/.github/subtrees.json vendored Normal file
View File

@ -0,0 +1,6 @@
[
{
"prefix": "common",
"url": "git@${CI_SERVER_HOST}:${GROUP}-subtrees/phreeqc3-src-common.git"
}
]

View File

@ -0,0 +1,22 @@
# This workflow lints the subtrees.json file to ensure it is valid and up-to-date.
# It is triggered on pull requests that modify the subtrees.json file or can be run manually
# via the GitHub Actions UI.
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 }}

32
phreeqcpp/.github/workflows/subtree.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Sync Subtrees
on:
workflow_dispatch:
inputs:
dryRun:
description: 'If true, dont 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
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 }}