Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 77 additions & 77 deletions .github/workflows/ss3-pr-open-issues.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
# Opens issues to r4ss, SSI, and doc repos when changes occur in SS3.
name: ss3-pr-open-issues.yml
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review']
# pull_request_target:
# types:
# - closed
jobs:
ss3-pr-open-issues:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GH_PAT }}
steps:
- name: Update Ubuntu packages
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev
- name: Get Pull Request Number
run: |
echo github.event.pull_request.number = ${{ github.event.pull_request.number }}
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
# with:
# use-public-rspm: true
- name: install the gh and curl pkgs
run:
Rscript -e "install.packages('gh')"
- name: Get pr info and save
run: |
Rscript -e 'info <- gh::gh("GET /repos/{owner}/{repo}/pulls/{pull_number}",
owner = "nmfs-ost",
repo = "ss3-source-code",
pull_number = "${{ github.event.pull_request.number }}")
saveRDS(info, file = "info.RDS")'
- name: Post issues, if needed
run: |
info <- readRDS("info.RDS")
pr_body <- strsplit(info$body, "\n" )[[1]]
pr_body <- gsub("\r", "", pr_body, fixed = TRUE)
# Get info on which repos need open issues, if a change log entry is needed.
# allow some flexibility for getting the spacing wrong, which is easy to do.
# look for checklist items like - []
needs_changes <- grep("-\\s*\\[\\s*\\]", pr_body, ignore.case = TRUE, value = TRUE)
issue_title <- paste0("Changes need for SS3 PR ", info$number)
issue_body <- paste0("Changes will be needed in this ",
"repository due to the opening of SS3 Pull Request ",
info$number, ".\n",
"Please see ",
"https://github.com/nmfs-ost/ss3-source-code/pull/",
info$number, " and its associated issues for more information.",
"\n\nNote: this issue was created automatically via GitHub ",
"Action using the workflow in \n",
"https://github.com/nmfs-ost/ss3-source-code/blob/main/.github/workflows/ss3-pr-open-issues.yml")
# post r4ss issue if needed
if (length(grep("r4ss", needs_changes)) == 1) {
gh::gh("POST /repos/{owner}/{repo}/issues",
owner = "r4ss",
repo = "r4ss",
title = issue_title,
body = issue_body)
}
# post SSI issue if needed
if (length(grep("SSI", needs_changes)) == 1) {
gh::gh("POST /repos/{owner}/{repo}/issues",
owner = "nmfs-ost",
repo = "ssi",
title = issue_title,
body = issue_body)
}
# post documentation issue, if needed
if (length(grep("manual", needs_changes)) == 1) {
gh::gh("POST /repos/{owner}/{repo}/issues",
owner = "nmfs-ost",
repo = "ss3-doc",
title = issue_title,
body = issue_body)
}
shell: Rscript {0}
# name: ss3-pr-open-issues.yml
# on:
# pull_request:
# types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review']
# pull_request_target:
# types:
# - closed
# jobs:
# ss3-pr-open-issues:
# if: github.event.pull_request.draft == false
# runs-on: ubuntu-latest
# env:
# GITHUB_PAT: ${{ secrets.GH_PAT }}
# steps:
# - name: Update Ubuntu packages
# run: sudo apt update && sudo apt install -y libcurl4-openssl-dev
# - name: Get Pull Request Number
# run: |
# echo github.event.pull_request.number = ${{ github.event.pull_request.number }}
# - uses: actions/checkout@v3
# - uses: r-lib/actions/setup-r@v2
# # with:
# # use-public-rspm: true
# - name: install the gh and curl pkgs
# run:
# Rscript -e "install.packages('gh')"
# - name: Get pr info and save
# run: |
# Rscript -e 'info <- gh::gh("GET /repos/{owner}/{repo}/pulls/{pull_number}",
# owner = "nmfs-ost",
# repo = "ss3-source-code",
# pull_number = "${{ github.event.pull_request.number }}")
# saveRDS(info, file = "info.RDS")'
# - name: Post issues, if needed
# run: |
# info <- readRDS("info.RDS")
# pr_body <- strsplit(info$body, "\n" )[[1]]
# pr_body <- gsub("\r", "", pr_body, fixed = TRUE)
# # Get info on which repos need open issues, if a change log entry is needed.
# # allow some flexibility for getting the spacing wrong, which is easy to do.
# # look for checklist items like - []
# needs_changes <- grep("-\\s*\\[\\s*\\]", pr_body, ignore.case = TRUE, value = TRUE)
# issue_title <- paste0("Changes need for SS3 PR ", info$number)
# issue_body <- paste0("Changes will be needed in this ",
# "repository due to the opening of SS3 Pull Request ",
# info$number, ".\n",
# "Please see ",
# "https://github.com/nmfs-ost/ss3-source-code/pull/",
# info$number, " and its associated issues for more information.",
# "\n\nNote: this issue was created automatically via GitHub ",
# "Action using the workflow in \n",
# "https://github.com/nmfs-ost/ss3-source-code/blob/main/.github/workflows/ss3-pr-open-issues.yml")
# # post r4ss issue if needed
# if (length(grep("r4ss", needs_changes)) == 1) {
# gh::gh("POST /repos/{owner}/{repo}/issues",
# owner = "r4ss",
# repo = "r4ss",
# title = issue_title,
# body = issue_body)
# }
# # post SSI issue if needed
# if (length(grep("SSI", needs_changes)) == 1) {
# gh::gh("POST /repos/{owner}/{repo}/issues",
# owner = "nmfs-ost",
# repo = "ssi",
# title = issue_title,
# body = issue_body)
# }
# # post documentation issue, if needed
# if (length(grep("manual", needs_changes)) == 1) {
# gh::gh("POST /repos/{owner}/{repo}/issues",
# owner = "nmfs-ost",
# repo = "ss3-doc",
# title = issue_title,
# body = issue_body)
# }
# shell: Rscript {0}
2 changes: 1 addition & 1 deletion SS_write_report.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ FUNCTION void write_bigoutput()
temp = abs(header_a_rd(f, i, 2));
if (temp > 999)
temp -= 1000;
SS2out << f << " " << fleetname(f) << " " << fleet_area(f) << Show_Time2(ALK_time) << " " << data_time(ALK_time, f, 1) << " " << data_time(ALK_time, f, 3) << " " << gen_a(f, i) << " " << mkt_a(f, i) << " " << ageerr_type_a(f, i) << " " << Lbin_lo(f, i) << " " << Lbin_hi(f, i) << " ";
SS2out << f << " " << fleetname(f) << " " << fleet_area(f) << Show_Time2(ALK_time) << " " << data_time(ALK_time, f, 1) << " " << data_time(ALK_time, f, 3) << " " << gen_a(f, i) << " " << mkt_a(f, i) << " " << ageerr_type_a(f, i) << " " << len_bins(Lbin_lo(f, i)) << " " << len_bins(Lbin_hi(f, i)) << " ";
if (header_a(f, i, 2) < 0 && in_superperiod == 0)
{
SS2out << " start ";
Expand Down