diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index bc09282..0000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: 'close stale issues/PRs' -on: - schedule: - - cron: '0 0 * * *' - workflow_dispatch: -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@87c2b794b9b47a9bec68ae03c01aeb572ffebdb1 - with: - repo-token: ${{ github.token }} - days-before-stale: 21 - days-before-close: 7 - only-labels: "" - operations-per-run: 100 - remove-stale-when-updated: true - debug-only: false - ascending: false - - exempt-issue-labels: "Status: Backlog,Status: In Progress" - stale-issue-label: "Status: Stale" - stale-issue-message: |- - This issue has gone three weeks without activity. In another week, I will close it. - - But! If you comment or otherwise update it, I will reset the clock, and if you label it `Status: Backlog` or `Status: In Progress`, I will leave it alone ... forever! - - ---- - - "A weed is but an unloved flower." ― _Ella Wheeler Wilcox_ 🥀 - skip-stale-issue-message: false - close-issue-label: "" - close-issue-message: "" - - exempt-pr-labels: "Status: Backlog,Status: In Progress" - stale-pr-label: "Status: Stale" - stale-pr-message: |- - This pull request has gone three weeks without activity. In another week, I will close it. - - But! If you comment or otherwise update it, I will reset the clock, and if you label it `Status: Backlog` or `Status: In Progress`, I will leave it alone ... forever! - - ---- - - "A weed is but an unloved flower." ― _Ella Wheeler Wilcox_ 🥀 - skip-stale-pr-message: false - close-pr-label: - close-pr-message: "" diff --git a/.github/workflows/test-helpers/make-issue b/.github/workflows/test-helpers/make-issue deleted file mode 100755 index 1585924..0000000 --- a/.github/workflows/test-helpers/make-issue +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -function download-and-extract-issue { - local issue_number="$1" - - # I tried `gh issue view` but it does whack stuff with the terminal that makes - # it non-trivial to redirect/pipe. Pulling from JSON is probably more robust - # anyway. - - gh api "/repos/:owner/:repo/issues/${issue_number}" > issue - gh api "/repos/:owner/:repo/issues/${issue_number}/comments" > issue-comments - - echo "${issue_number}" > issue-number - jq -r '.state' issue > issue-state - jq -r '.labels[].name' issue > issue-labels - jq -r '.comments' issue > issue-ncomments - jq -r '.[0].body' issue-comments > issue-comment -} - - -function download-and-extract-log { - local issue_number="$1" - echo "Determining workflow run ID for issue #${issue_number} ..." - - # I'm not finding a good way to determine, given a list of workflow runs, - # which run corresponds precisely to a given issue's event. We have to - # download the log to be certain. Since that's complicated, for now I'm just - # looking at the last run, and ensuring that this is always the correct run - # by serializing the tests using `needs`. - - rm -rf log.zip log - run_id=$( - gh api "repos/:owner/:repo/actions/workflows/validate-new-issue.yml/runs" \ - | jq ".workflow_runs[0] | .id" - ) - if [ -z "$run_id" ]; then - echo "No run_id." - return 1 - fi - echo "Downloading logs for workflow run ${run_id} ..." - gh api "repos/:owner/:repo/actions/runs/${run_id}/logs" > log.zip - if [ $? -gt 0 ]; then - echo "Trouble downloading?" - return 1 - fi - echo "Extracting validation log ..." - logfile="validate-new-issue/3_Validate new issue.txt" - unzip log.zip "$logfile" - # Strip initial echo of whole run body. https://unix.stackexchange.com/a/218144 - { sed -ne'/##\[endgroup]/q;H;1h;$!d;x;p'; cat; } < "$logfile" > log - rm "$logfile" - rm -rf validate-new-issue - rm log.zip - echo "Are we indeed looking at the right issue?" - expected="${issue_number}" - actual=$(grep 'Validating issue #[0-9]*\.[^"]' log | sed -Ee 's/.*#([0-9]*)\..*/\1/') - echo "Expected: ${expected}" - echo "Actual: ${actual}" - test "$actual" = "$expected" -} - -function backoff { - echo "Trying $1 several times with backoff ..." - for i in {0..6}; do - [ $i -gt 0 ] && sleep $(( 2 ** $i )) - echo "::group::Trying $1 ..." - $1 $2 && echo "::endgroup::" && return - echo "::endgroup::" - done - echo "$1 backed right off the edge! 😧" - exit 1 -} - -issue_number=$( - basename $( - gh issue create --title "${2:-Greetings, program!}" --body "$1" - ) -) -echo "Downloading and extracting the validation workflow run log for issue #${issue_number}." -backoff download-and-extract-log "$issue_number" -echo "Log downloaded and extracted successfully." -echo "::group::Log:" -cat log -echo "::endgroup::" -download-and-extract-issue "$issue_number" -echo "::group::Issue:" -echo "Issue: $(cat issue-number)" -echo "State: $(cat issue-state)" -echo "Labels: $(cat issue-labels | tr '\n' ',')" -echo "Comments: $(cat issue-ncomments)" -echo "Comment: " -cat issue-comment | sed -e 's/^/ | /' -echo "::endgroup::"