Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/add-issue-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ on:
issues:
types: [opened]

permissions:
contents: read

jobs:
triage:
permissions:
contents: read # for github/issue-labeler to get repo contents
issues: write # for github/issue-labeler to create or remove labels
runs-on: ubuntu-latest
steps:
# Update .github/labeler.yml for new dialects
- uses: github/issue-labeler@v3.2
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: github/issue-labeler@98b5412841f6c4b0b3d9c29d53c13fad16bd7de2 # v3.2
with:
configuration-path: .github/labeler.yml
include-title: 1
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/add-to-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,23 @@ on:
push:
branches:
- main
permissions:
contents: read

jobs:
draft-release:
permissions:
contents: write # for release-drafter/release-drafter to create a github release
pull-requests: write # for release-drafter/release-drafter to add label to PR
runs-on: ubuntu-latest
if: github.repository == 'sqlfluff/sqlfluff'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- name: Update release notes
uses: release-drafter/release-drafter@v6
uses: release-drafter/release-drafter@6a93d829887aa2e0748befe2e808c66c0ec6e4c7 # v6.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions .github/workflows/ci-pr-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ jobs:
if: >
github.event.workflow_run.event == 'pull_request'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- name: 'Download txt artifact'
uses: actions/github-script@v6
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand All @@ -44,7 +49,7 @@ jobs:
run: unzip cov-report.zip

- name: Update PR comment with coverage report.
uses: actions/github-script@v6
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/ci-test-dbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ on:
gh_token:
required: true

permissions:
contents: read

jobs:
modular-python-test:
name: py${{ inputs.python-version }}-${{ inputs.dbt-version }}
Expand All @@ -54,10 +57,15 @@ jobs:
- 5432:5432

steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
Expand All @@ -77,7 +85,7 @@ jobs:
run: tox -e ${{ inputs.dbt-version }} -- plugins/sqlfluff-templater-dbt

- name: Upload coverage data (github)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.coverage }}
with:
name: coverage-data-py${{ inputs.python-version }}-${{ inputs.dbt-version }}
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/ci-test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,23 @@ on:
gh_token:
required: true

permissions:
contents: read

jobs:
modular-python-test:
runs-on: ubuntu-latest
name: py${{ inputs.python-version }}
steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
Expand Down Expand Up @@ -81,7 +89,7 @@ jobs:
for file in .coverage.*; do mv "$file" "$file.$COVSUFFIX"; done;

- name: Upload coverage data (github)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.coverage }}
with:
name: coverage-data-py${{ inputs.python-version }}-${{ inputs.marks }}
Expand Down
74 changes: 56 additions & 18 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#merge_group
types: [checks_requested]

permissions:
contents: read

jobs:

linting:
Expand All @@ -50,9 +53,14 @@ jobs:
python-version: "3.12"
name: ${{ matrix.job }} tests
steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -160,9 +168,14 @@ jobs:
ymlchecks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.13'
- name: Install dependencies
Expand All @@ -186,9 +199,14 @@ jobs:
runs-on: ubuntu-latest
name: example tests
steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.13'
- name: Install dependencies
Expand All @@ -207,13 +225,18 @@ jobs:
runs-on: windows-latest
name: Python 3.13 Windows tests
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"
- name: List Env
Expand All @@ -232,7 +255,7 @@ jobs:
mkdir temp_pytest
python -m tox -e winpy -- --cov=sqlfluff -n 2 test -m "not integration"
- name: Upload coverage data (github)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-data-winpy3.13
path: ".coverage.*"
Expand All @@ -243,6 +266,11 @@ jobs:
runs-on: windows-latest
name: dbt Plugin Python 3.12 Windows tests
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- name: Start PostgreSQL on Windows
run: |
$pgService = Get-Service -Name postgresql*
Expand All @@ -255,9 +283,9 @@ jobs:
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
# NOTE: As of 2024-10-10, dbt does not yet support python 3.13.
python-version: "3.12"
Expand All @@ -278,11 +306,16 @@ jobs:
if: github.event_name == 'pull_request'
name: pip install tests
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Install dependencies
run: |
pip install .
Expand All @@ -307,15 +340,20 @@ jobs:
runs-on: ubuntu-latest
needs: [python-version-tests, dbt-tests, python-windows-tests, dialect-tests]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.13"

- run: python -m pip install --upgrade coverage[toml]

- name: Download coverage data.
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: coverage-data-*
merge-multiple: true
Expand All @@ -332,7 +370,7 @@ jobs:
python -m coverage report --fail-under=100 --skip-covered --skip-empty -m | tee coverage-report.txt

- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: html-report
path: htmlcov
Expand All @@ -349,7 +387,7 @@ jobs:
# NOTE: We don't actually comment on the PR from here, we'll do that in
# a more secure way by triggering a more secure workflow.
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: txt-report
path: |
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/create-release-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Abort if branch already exists
run: |
_check_branch=$(git ls-remote --heads origin prep-${{ github.event.inputs.newVersionNumber }})
Expand All @@ -23,7 +28,7 @@ jobs:
fi

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.11'

Expand All @@ -39,7 +44,7 @@ jobs:
GITHUB_REPOSITORY_OWNER: ${{ secrets.GITHUB_REPOSITORY_OWNER }}

- name: Create pull request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
with:
delete-branch: true
branch: prep-${{ github.event.inputs.newVersionNumber }}
Expand Down Expand Up @@ -68,7 +73,7 @@ jobs:
skip-changelog

- name: Update release title and tag
uses: release-drafter/release-drafter@v6
uses: release-drafter/release-drafter@6a93d829887aa2e0748befe2e808c66c0ec6e4c7 # v6.4.0
with:
# NOTE: We should eventually actually populate the date here, but that
# will most likely change before the new pull request actually gets
Expand Down
Loading