File tree Expand file tree Collapse file tree 3 files changed +56
-1
lines changed
Expand file tree Collapse file tree 3 files changed +56
-1
lines changed Original file line number Diff line number Diff line change 1+ name : CI for Sqruff CLI Action
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ test-action :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - name : Checkout
10+ uses : actions/checkout@v4
11+
12+ - name : Test Install Without Version
13+ uses : ./
14+
15+ - name : Test Install Latest Version
16+ uses : ./
17+ with :
18+ version : ' latest'
19+
20+ - name : Test Install Specific Version
21+ uses : ./
22+ with :
23+ version : ' v0.4.0'
24+ - name : Verify Installation
25+ run : sqruff --version
Original file line number Diff line number Diff line change 1- # install-sqruff-cli-action-
1+ # install-sqruff-cli-action
2+
23GitHub Action to install sqruff
Original file line number Diff line number Diff line change 1+ name : ' Install Sqruff CLI'
2+ description : ' Installs the Sqruff CLI on Ubuntu'
3+ branding :
4+ color : black
5+ icon : arrow-down-circle
6+ inputs :
7+ version :
8+ description : ' Version of Sqruff CLI to install'
9+ required : false
10+ default : ' latest'
11+ runs :
12+ using : ' composite'
13+ steps :
14+ - run : |
15+ if [ "${{ inputs.version }}" = "latest" ]; then
16+ # Fetch the latest release tag from GitHub API without authentication
17+ LATEST_VERSION=$(curl -s https://api.github.com/repos/quarylabs/sqruff/releases/latest | grep 'tag_name' | cut -d '"' -f 4)
18+ echo "Latest version is $LATEST_VERSION"
19+ VERSION=$LATEST_VERSION
20+ else
21+ VERSION=${{ inputs.version }}
22+ fi
23+
24+ echo "Installing Sqruff CLI version $VERSION"
25+ wget https://github.com/quarylabs/sqruff/releases/download/$VERSION/sqruff-linux-x86_64-musl.tar.gz -O sqruff-cli.tar.gz
26+ tar -xzf sqruff-cli.tar.gz
27+ sudo mv sqruff /usr/local/bin/sqruff
28+ sqruff --version
29+ shell: bash
You can’t perform that action at this time.
0 commit comments