From 526c91712e7873779b2c3bb96984ed725e40ade6 Mon Sep 17 00:00:00 2001 From: cansavvy Date: Thu, 29 Feb 2024 09:09:06 -0500 Subject: [PATCH] mysterious error --- .github/workflows/check-url.yml | 12 ++---------- scripts/find_issue.R | 10 +++++----- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml index 983a435c..9e1c790e 100644 --- a/.github/workflows/check-url.yml +++ b/.github/workflows/check-url.yml @@ -88,18 +88,10 @@ jobs: echo "$GITHUB_REPOSITORY" issue_exists=$(Rscript --vanilla scripts/find_issue.R --repo $GITHUB_REPOSITORY --git_pat $GH_PAT) echo URL issue exists: $issue_exists - echo "issue_exists=$issue_exists" >> $GITHUB_OUTPUT - - # We want to retrieve this file after this runs so we can see what spell check errors were detected - - name: Archive session info - uses: actions/upload-artifact@v3 - # These arguments underneath `with` are generally action specific so we have to check the documentation: https://github.com/marketplace/actions/upload-a-build-artifact - with: - name: session_info.txt - path: session_info.txt + echo "issue_existence=$issue_exists" >> $GITHUB_OUTPUT - name: If too many URL errors, then make an issue - if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_exists == true}} + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_existence >= 1}} uses: JasonEtco/create-an-issue@v2 with: filename: .github/ISSUE_TEMPLATE/url-error.md diff --git a/scripts/find_issue.R b/scripts/find_issue.R index 7a3f753f..d9646a36 100644 --- a/scripts/find_issue.R +++ b/scripts/find_issue.R @@ -36,14 +36,14 @@ if (!is.character(repo)) { install.packages('gh', repos='http://cran.us.r-project.org') -my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", - repo = repo, - .token = git_pat, - per_page = 100) +my_issues <- gh::gh("GET https://api.github.com/repos/{repo}/issues", + repo = repo, + .token = git_pat) + my_issues <- unlist(my_issues) issue_titles <- my_issues[which(names(my_issues) == "title")] issue_exists <- any(grep('Broken URLs found in the course!', issue_titles)) # Print out the result -write(as.character(issue_exists), stdout()) +write(length(issue_exists), stdout())