Skip to content

Commit

Permalink
fix: Default version if no GH, update linter to ensure conventional c…
Browse files Browse the repository at this point in the history
…ommit
  • Loading branch information
highb committed Dec 11, 2023
1 parent 542e475 commit ab98760
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
branches:
- main
pull_request:
branches:
- main

permissions:
pull-requests: read
contents: read

jobs:
shellcheck:
Expand Down Expand Up @@ -34,3 +40,10 @@ jobs:
- name: Run shfmt
run: scripts/shfmt.bash

pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 10 additions & 5 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ sort_versions() {
}

list_github_tags() {
git ls-remote --tags --refs "$GH_REPO" |
grep -oE 'refs/tags/v[0-9]+.[0-9]+.[0-9]+$' |
cut -d/ -f3- |
sed 's/^v//' |
sort -V
if [ -n "${GITHUB_API_TOKEN:-}" ]; then
git ls-remote --tags --refs "$GH_REPO" |
grep -oE 'refs/tags/v[0-9]+.[0-9]+.[0-9]+$' |
cut -d/ -f3- |
sed 's/^v//' |
sort -V
else
# If we can't use the GitHub API, we'll just hardcode the latest version
echo "14.2.2"
fi
}

list_all_versions() {
Expand Down

0 comments on commit ab98760

Please sign in to comment.