Skip to content

Commit

Permalink
Update GHA configurations (#268)
Browse files Browse the repository at this point in the history
* Update and pin action versions for workflows

* Add read constraints on read-only jobs

* Add workflow for CodeQL
  • Loading branch information
nateprewitt authored Jul 21, 2023
1 parent 1eef558 commit 6622ca0
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
paths:
- "s3transfer/"
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "CodeQL"

on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
schedule:
- cron: "0 0 * * 5"

permissions: "read-all"

jobs:
analyze:
name: "Analyze"
runs-on: "ubuntu-latest"
permissions:
actions: read
contents: read
security-events: write
steps:
- name: "Checkout repository"
uses: "actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3"

- name: "Run CodeQL init"
uses: "github/codeql-action/init@cdcdbb579706841c47f7063dda365e292e5cad7a"
with:
config-file: "./.github/codeql.yml"
languages: "python"

- name: "Run CodeQL autobuild"
uses: "github/codeql-action/autobuild@cdcdbb579706841c47f7063dda365e292e5cad7a"

- name: "Run CodeQL analyze"
uses: "github/codeql-action/analyze@cdcdbb579706841c47f7063dda365e292e5cad7a"
3 changes: 3 additions & 0 deletions .github/workflows/fail-master-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
fail:
runs-on: ubuntu-latest
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ on:
pull_request:
branches-ignore: [ master ]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: 3.9
- name: Run pre-commit
uses: pre-commit/action@v2.0.0
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
4 changes: 2 additions & 2 deletions .github/workflows/run-crt-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and CRT
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
branches-ignore: [ master ]

permissions:
contents: read

jobs:
build:

Expand All @@ -15,9 +18,9 @@ jobs:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -27,6 +30,6 @@ jobs:
run: |
python scripts/ci/run-tests --with-cov
- name: codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
directory: tests

0 comments on commit 6622ca0

Please sign in to comment.