Skip to content

Commit

Permalink
feat(bug-report): generate only last X
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce committed Feb 14, 2025
1 parent be6bedd commit 5f7b409
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,20 @@ body:
description: "You can run flowr as `flowr --version` to find out (with docker: `docker run --rm flowr --version`)."
options:
# START::Versions
- (latest)
- <Older> (please consider updating)
- v2.1.8 (Nov 28, 2024)
- v2.1.9 (Dec 21, 2024)
- v2.1.10 (Jan 5, 2025)
- v2.1.11 (Jan 8, 2025)
- v2.1.12 (Jan 10, 2025)
- v2.2.0 (Jan 16, 2025)
- v2.2.1 (Jan 16, 2025)
- v2.2.3 (Feb 12, 2025)
- Unknown
- Unreleased/Dev
# END::Versions
# START::DefaultVersion
default: 0
default: 8
# END::DefaultVersion
validations:
required: true
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/broken-links-and-wiki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
submodules: true
lfs: true
token: ${{ secrets.RELEASE_TOKEN }}
fetch-tags: true
fetch-depth: 0

- name: "🌍 Load Versions to Use"
id: doc-global-versions
Expand Down Expand Up @@ -99,16 +101,18 @@ jobs:
update_wiki_page "Core" wiki:core
# check for an update in the versions! (including the updated name information)
ALL_TAGS=$( git tag --list --format="%(tag) (%(creatordate))" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sed -E 's/^(v[0-9]+\.[0-9]+\.[0-9]+)\s*\(([a-zA-Z]+\s*)([a-zA-Z]+)\s*([0-9]+)\s*[0-9:]+\s+([0-9]+).*/\1 (\3 \4, \5)/' | sort -V)
LIMIT_TO_LAST=8
ALL_TAGS=$( git tag --list --format="%(tag) (%(creatordate))" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sed -E 's/^(v[0-9]+\.[0-9]+\.[0-9]+)\s*\(([a-zA-Z]+\s*)([a-zA-Z]+)\s*([0-9]+)\s*[0-9:]+\s+([0-9]+).*/\1 (\3 \4, \5)/' | sort -V | tail -n$LIMIT_TO_LAST)
NUM_OF_TAGS=$(echo "$ALL_TAGS" | wc -l)
LATEST_TAG=$(echo "$ALL_TAGS" | tail -n1)
# add (latest) to the latest tag
ALL_TAGS=$(sed -E "s/^$LATEST_TAG$/$LATEST_TAG (latest)/" <<< "$ALL_TAGS")
ALL_TAGS=$(echo -e "<Older> (please consider updating)\n$ALL_TAGS")
ALL_TAGS+="\nUnknown\nUnreleased/Dev"
ALL_TAGS=$(echo -e "$ALL_TAGS" | sed -E 's/^(.*)$/ - \1/')
cp .github/ISSUE_TEMPLATE/bug-report.yaml .github/ISSUE_TEMPLATE/bug-report.yaml.tmp
sed -i -E "/\s*# START::Versions/,/\s*# END::Versions/c\\# START::Versions\n$(echo "$ALL_TAGS" | sed 's/$/\\/' ) \n# END::Versions" .github/ISSUE_TEMPLATE/bug-report.yaml
sed -i -E "/\s*# START::DefaultVersion/,/\s*# END::DefaultVersion/c\\# START::DefaultVersion\n default: $((NUM_OF_TAGS - 1))\n# END::DefaultVersion" .github/ISSUE_TEMPLATE/bug-report.yaml
sed -i -E "/\s*# START::DefaultVersion/,/\s*# END::DefaultVersion/c\\# START::DefaultVersion\n default: $((NUM_OF_TAGS))\n# END::DefaultVersion" .github/ISSUE_TEMPLATE/bug-report.yaml
if ! diff -q .github/ISSUE_TEMPLATE/bug-report.yaml .github/ISSUE_TEMPLATE/bug-report.yaml.tmp; then
echo "Versions in the bug-report changed!"
echo "CHANGED=true" >> $GITHUB_ENV
Expand Down

0 comments on commit 5f7b409

Please sign in to comment.