Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GHA configurations #2989

Merged
merged 3 commits into from
Jul 22, 2023
Merged
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
2 changes: 2 additions & 0 deletions .github/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
paths:
- "botocore/"
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this specific hash? Same question for the ones below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to add another commit to move everything to pins. I have the end result in the S3transfer PR.

The main goal is to ensure that we're always using a known state when running actions. That means if a repository is compromised and a new commit with malicious code is made under a known tag, we don't run the malicious code. The ability to compromise a repository and rewrite the history to create the same commit hash is almost impossible.

Full information can be found here: https://github.com/ossf/scorecard/blob/e1eede2d3fa09d08bbc00ca2331c2bffebdc602d/docs/checks.md#pinned-dependencies


- 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
3 changes: 3 additions & 0 deletions .github/workflows/lint.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:
lint:
runs-on: ubuntu-20.04
Expand Down
3 changes: 3 additions & 0 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:
runs-on: '${{ matrix.os }}'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/stale_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: "Close stale issues"
# Controls when the action will run.
on:
schedule:
- cron: "0 * * * *"
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
issue-cleanup:
Expand Down