-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de1a2d7
commit c304534
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: CI for Sqruff CLI Action | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test-action: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test Install Without Version | ||
uses: ./ | ||
|
||
- name: Test Install Latest Version | ||
uses: ./ | ||
with: | ||
version: 'latest' | ||
|
||
- name: Test Install Specific Version | ||
uses: ./ | ||
with: | ||
version: 'v0.4.0' | ||
- name: Verify Installation | ||
run: sqruff --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# install-sqruff-cli-action- | ||
# install-sqruff-cli-action | ||
|
||
GitHub Action to install sqruff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'Install Sqruff CLI' | ||
description: 'Installs the Sqruff CLI on Ubuntu' | ||
branding: | ||
color: black | ||
icon: arrow-down-circle | ||
inputs: | ||
version: | ||
description: 'Version of Sqruff CLI to install' | ||
required: false | ||
default: 'latest' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- run: | | ||
if [ "${{ inputs.version }}" = "latest" ]; then | ||
# Fetch the latest release tag from GitHub API without authentication | ||
LATEST_VERSION=$(curl -s https://api.github.com/repos/quarylabs/sqruff/releases/latest | grep 'tag_name' | cut -d '"' -f 4) | ||
echo "Latest version is $LATEST_VERSION" | ||
VERSION=$LATEST_VERSION | ||
else | ||
VERSION=${{ inputs.version }} | ||
fi | ||
echo "Installing Sqruff CLI version $VERSION" | ||
wget https://github.com/quarylabs/sqruff/releases/download/$VERSION/sqruff-linux-x86_64-gnu.zip -O sqruff-cli.zip | ||
unzip sqruff-cli.zip -d sqruff-cli | ||
sudo mv sqruff-cli/sqruff /usr/local/bin/sqruff | ||
sqruff --version | ||
shell: bash |