From 650e86081c935a7be12b35e49bf15eda914768d3 Mon Sep 17 00:00:00 2001 From: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com> Date: Mon, 19 Oct 2026 16:28:44 -0400 Subject: [PATCH 1/2] separate update example gha by model --- .github/workflows/update-bam-example-data.yml | 39 +++++++++++++++++++ .github/workflows/update-example-data.yml | 39 +++++++++++++++++++ .../update-rceattle-example-data.yml | 2 +- .github/workflows/update-ss3-example-data.yml | 13 +++---- 4 files changed, 84 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/update-bam-example-data.yml create mode 100644 .github/workflows/update-example-data.yml diff --git a/.github/workflows/update-bam-example-data.yml b/.github/workflows/update-bam-example-data.yml new file mode 100644 index 00000000..50072b15 --- /dev/null +++ b/.github/workflows/update-bam-example-data.yml @@ -0,0 +1,39 @@ +# Update example data when convert_output.R or variable-name resources change +name: update-bam-example-data +on: + pull_request: + branches: [main] + paths: + - 'R/conout_bam.R' + - 'inst/resources/bam_var_names.csv' + workflow_dispatch: +jobs: + update-example-data: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }} + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pak, any::usethis, local::. + + - name: Update example data + run: Rscript data-raw/DATASET_BAM.R + + - name: Commit and push updated example data + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add data/VermilionSnapper.rda + git diff --cached --quiet || git commit -m "chore: update BAM vermilion snapper example from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" + git push diff --git a/.github/workflows/update-example-data.yml b/.github/workflows/update-example-data.yml new file mode 100644 index 00000000..1c6a03a2 --- /dev/null +++ b/.github/workflows/update-example-data.yml @@ -0,0 +1,39 @@ +# Update example data when convert_output.R or variable-name resources change +name: update-example-data +on: + pull_request: + branches: [main] + paths: + - 'R/conout_ss3.R' + - 'inst/resources/ss3_var_names.csv' + workflow_dispatch: +jobs: + update-example-data: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }} + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pak, any::usethis, local::. + + - name: Update example data + run: Rscript data-raw/DATASET.R + + - name: Commit and push updated example data + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add data/example_data.rda + git diff --cached --quiet || git commit -m "chore: update SS3 example_data from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" + git push diff --git a/.github/workflows/update-rceattle-example-data.yml b/.github/workflows/update-rceattle-example-data.yml index d9ba8e6e..fbefdaed 100644 --- a/.github/workflows/update-rceattle-example-data.yml +++ b/.github/workflows/update-rceattle-example-data.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [main] paths: - - 'R/convert_output.R' + - 'R/conout_rceattle.R' - 'inst/resources/rceattle_var_names.csv' workflow_dispatch: jobs: diff --git a/.github/workflows/update-ss3-example-data.yml b/.github/workflows/update-ss3-example-data.yml index 6dca7f56..51568327 100644 --- a/.github/workflows/update-ss3-example-data.yml +++ b/.github/workflows/update-ss3-example-data.yml @@ -1,14 +1,11 @@ # Update example data when convert_output.R or variable-name resources change -name: update-example-data +name: update-ss3-example-data on: pull_request: branches: [main] paths: - - 'R/convert_output.R' - - 'inst/resources/bam_var_names.csv' + - 'R/conout_ss3.R' - 'inst/resources/ss3_var_names.csv' - - 'inst/resources/rceattle_var_names.csv' - - 'inst/resources/fims_var_names.csv' workflow_dispatch: jobs: update-example-data: @@ -30,13 +27,13 @@ jobs: extra-packages: any::pak, any::usethis, local::. - name: Update example data - run: Rscript data-raw/DATASET.R + run: Rscript data-raw/DATASET_SS3.R - name: Commit and push updated example data if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add data/example_data.rda - git diff --cached --quiet || git commit -m "chore: update example_data from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" + git add data/ss3_simple.rda + git diff --cached --quiet || git commit -m "chore: update SS3 r4ss example_data from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" git push From 9bd31245601280ede22e940472409fd7b2b4ed15 Mon Sep 17 00:00:00 2001 From: Sam Schiano <125507018+Schiano-NOAA@users.noreply.github.com> Date: Wed, 21 Oct 2026 14:33:29 -0400 Subject: [PATCH 2/2] add notes to specify example data in gha script and update vermilion snapper save file name --- .github/workflows/update-bam-example-data.yml | 2 +- .github/workflows/update-example-data.yml | 2 +- .github/workflows/update-rceattle-example-data.yml | 2 +- .github/workflows/update-ss3-example-data.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-bam-example-data.yml b/.github/workflows/update-bam-example-data.yml index 50072b15..d8101a72 100644 --- a/.github/workflows/update-bam-example-data.yml +++ b/.github/workflows/update-bam-example-data.yml @@ -34,6 +34,6 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add data/VermilionSnapper.rda + git add data/vermilion_snapper.rda git diff --cached --quiet || git commit -m "chore: update BAM vermilion snapper example from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" git push diff --git a/.github/workflows/update-example-data.yml b/.github/workflows/update-example-data.yml index 1c6a03a2..02244c4b 100644 --- a/.github/workflows/update-example-data.yml +++ b/.github/workflows/update-example-data.yml @@ -1,4 +1,4 @@ -# Update example data when convert_output.R or variable-name resources change +# Update ss3 example data from Report.sso when convert_output.R or variable-name resources change name: update-example-data on: pull_request: diff --git a/.github/workflows/update-rceattle-example-data.yml b/.github/workflows/update-rceattle-example-data.yml index fbefdaed..97f6ebd2 100644 --- a/.github/workflows/update-rceattle-example-data.yml +++ b/.github/workflows/update-rceattle-example-data.yml @@ -1,4 +1,4 @@ -# Update example data when convert_output.R or variable-name resources change +# Update Rceattle example data when convert_output.R or variable-name resources change name: update-rceattle-example-data on: pull_request: diff --git a/.github/workflows/update-ss3-example-data.yml b/.github/workflows/update-ss3-example-data.yml index 51568327..789c187f 100644 --- a/.github/workflows/update-ss3-example-data.yml +++ b/.github/workflows/update-ss3-example-data.yml @@ -1,4 +1,4 @@ -# Update example data when convert_output.R or variable-name resources change +# Update ss3 example data from r4ss object when convert_output.R or variable-name resources change name: update-ss3-example-data on: pull_request: