Skip to content

Commit 9865845

Browse files
authored
Merge pull request #431 from github/claude/update-github-workflows-pinned-dependencies
fix: pin GitHub Actions dependencies to SHA hashes for security
2 parents ca5966b + 13fd573 commit 9865845

File tree

9 files changed

+22
-30
lines changed

9 files changed

+22
-30
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
# If you do not check out your code, Copilot will do this for you.
2727
steps:
2828
- name: Checkout code
29-
uses: actions/checkout@v6.0.2
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3030
with:
3131
persist-credentials: false
3232

3333
- name: Set up Python
34-
uses: actions/setup-python@v6.2.0
34+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3535
with:
3636
python-version: 3.12
3737

.github/workflows/docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6.0.2
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
with:
1919
persist-credentials: false
2020
- name: Build the Docker image

.github/workflows/linter.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ jobs:
1818
statuses: write
1919
steps:
2020
- name: Checkout Code
21-
uses: actions/checkout@v6.0.2
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2222
with:
2323
# Full git history is needed to get a proper
2424
# list of changed files within `super-linter`
2525
fetch-depth: 0
2626
persist-credentials: false
2727
- name: Setup Python
28-
uses: actions/setup-python@v6.2.0
28+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2929
with:
3030
python-version: "3.12"
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
3434
pip install -r requirements.txt -r requirements-test.txt
3535
- name: Lint Code Base
36-
uses: super-linter/super-linter@502f4fe48a81a392756e173e39a861f8c8efe056
36+
uses: super-linter/super-linter@61abc07d755095a68f4987d1c2c3d1d64408f1f9 # v8.5.0
3737
env:
3838
DEFAULT_BRANCH: main
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/major-version-updater.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout Repo
20-
uses: actions/checkout@v6.0.2
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121
with:
2222
fetch-tags: true
2323
ref: ${{ github.event.inputs.TAG_NAME || github.ref }}

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
matrix:
2020
python-version: [3.11, 3.12, 3.13]
2121
steps:
22-
- uses: actions/checkout@v6.0.2
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
persist-credentials: false
2525
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v6.2.0
26+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2727
with:
2828
python-version: ${{ matrix.python-version }}
2929
- name: Install dependencies

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: "Checkout code"
28-
uses: actions/checkout@v6.0.2
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
with:
3030
persist-credentials: false
3131

@@ -36,7 +36,7 @@ jobs:
3636
results_format: sarif
3737
publish_results: true
3838
- name: "Upload artifact"
39-
uses: actions/upload-artifact@v6.0.0
39+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
4040
with:
4141
name: SARIF file
4242
path: results.sarif

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
stale:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/stale@v10.1.1
14+
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
1515
with:
1616
stale-issue-message: "This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days."
1717
close-issue-message: "This issue was closed because it has been stalled for 35 days with no activity."

.github/workflows/use-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
packages: read
2020
steps:
2121
- name: Checkout code
22-
uses: actions/checkout@v6.0.2
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
with:
2424
persist-credentials: false
2525
- name: Run stale_repos tool

stale_repos.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,8 @@ def get_days_since_last_release(repo):
188188
last_release = next(repo.releases())
189189
return (datetime.now(timezone.utc) - last_release.created_at).days
190190
except TypeError:
191-
print(
192-
f"{repo.html_url} had an exception trying to get the last release.\
193-
Potentially caused by ghost user."
194-
)
191+
print(f"{repo.html_url} had an exception trying to get the last release.\
192+
Potentially caused by ghost user.")
195193
return None
196194
except StopIteration:
197195
return None
@@ -233,17 +231,13 @@ def get_active_date(repo):
233231
return None
234232
active_date = parse(last_push_str)
235233
else:
236-
raise ValueError(
237-
f"""
234+
raise ValueError(f"""
238235
ACTIVITY_METHOD environment variable has unsupported value: '{activity_method}'.
239236
Allowed values are: 'pushed' and 'default_branch_updated'
240-
"""
241-
)
237+
""")
242238
except github3.exceptions.GitHubException:
243-
print(
244-
f"{repo.html_url} had an exception trying to get the activity date.\
245-
Potentially caused by ghost user."
246-
)
239+
print(f"{repo.html_url} had an exception trying to get the activity date.\
240+
Potentially caused by ghost user.")
247241
return None
248242
return active_date
249243

@@ -254,7 +248,7 @@ def output_to_json(inactive_repos, file=None):
254248
Args:
255249
inactive_repos: A list of dictionaries containing the repo,
256250
days inactive, the date of the last push,
257-
visiblity of the repository (public/private),
251+
visibility of the repository (public/private),
258252
days since the last release, and days since the last pr.
259253
260254
Returns:
@@ -339,10 +333,8 @@ def set_repo_data(
339333
try:
340334
repo_data["days_since_last_pr"] = get_days_since_last_pr(repo)
341335
except github3.exceptions.GitHubException:
342-
print(
343-
f"{repo.html_url} had an exception trying to get the last PR.\
344-
Potentially caused by ghost user."
345-
)
336+
print(f"{repo.html_url} had an exception trying to get the last PR.\
337+
Potentially caused by ghost user.")
346338

347339
print(f"{repo.html_url} {days_inactive} days inactive") # type: ignore
348340
return repo_data

0 commit comments

Comments
 (0)