Skip to content

Commit cad0b19

Browse files
authored
Pin commit hash of github actions to avoid supply chain attacks (#772)
## Changes To avoid supply chain attacks, specify actions in GitHub Actions workflows using commit hashes instead of version numbers. Pinact-action will fail the CI job if this is not done. Renovate already supports updates in the commit hash state, so there is no issue. ## References - https://github.com/suzuki-shunsuke/pinact-action - does pinact-action verify the checksum of the version of aqua it is using? Yes!: - https://github.com/suzuki-shunsuke/pinact ## Other repositories - line/line-bot-sdk-python #772 - line/line-bot-sdk-php line/line-bot-sdk-php#680 - line/line-bot-sdk-nodejs line/line-bot-sdk-nodejs#1201 - line/line-bot-sdk-java line/line-bot-sdk-java#1576 - line/line-bot-sdk-go line/line-bot-sdk-go#555 - line/line-bot-sdk-ruby line/line-bot-sdk-ruby#405 - line/line-openapi line/line-openapi#90
1 parent bd85b97 commit cad0b19

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

.github/workflows/auto-testing.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- '3.12'
2121
- '3.13'
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424
with:
2525
submodules: true
2626
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030
- name: Install dependencies
@@ -53,11 +53,11 @@ jobs:
5353
- '3.12'
5454
- '3.13'
5555
steps:
56-
- uses: actions/checkout@v4
56+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5757
with:
5858
submodules: true
5959
- name: Set up Python ${{ matrix.python-version }}
60-
uses: actions/setup-python@v5
60+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
6161
with:
6262
python-version: ${{ matrix.python-version }}
6363
- name: Install dependencies & lib
@@ -66,3 +66,14 @@ jobs:
6666
pip install -e .
6767
- name: Run import check
6868
run: python import_check.py
69+
70+
pinact:
71+
runs-on: ubuntu-latest
72+
permissions:
73+
contents: read
74+
steps:
75+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
76+
- name: Run pinact
77+
uses: suzuki-shunsuke/pinact-action@a6896d13d22e2bf108a78b0c52d3f867c1f41b34 # v0.2.1
78+
with:
79+
skip_push: "true"

.github/workflows/check-eol-newrelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out code
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1515

1616
- name: Run EoL & NewRelease check
17-
uses: actions/github-script@v7
17+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
1818
with:
1919
script: |
2020
const checkEolAndNewReleases = require('.github/scripts/check-eol-newrelease.cjs');

.github/workflows/close-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
issues: write
1313
pull-requests: write
1414
steps:
15-
- uses: actions/stale@v9
15+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
1616
with:
1717
days-before-issue-stale: 14
1818
days-before-issue-close: 0

.github/workflows/create-draft-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
needs: validate-input
4444

4545
steps:
46-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4747
- name: Fetch Latest Release
4848
id: get-latest-release
49-
uses: actions/github-script@v7
49+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
5050
with:
5151
script: |
5252
const latestRelease = await github.rest.repos.getLatestRelease({
@@ -62,7 +62,7 @@ jobs:
6262
6363
- name: Calculate New Version
6464
id: calculate-version
65-
uses: actions/github-script@v7
65+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
6666
with:
6767
script: |
6868
const latestTag = '${{ steps.get-latest-release.outputs.latest_tag }}';
@@ -83,7 +83,7 @@ jobs:
8383
8484
- name: Generate Release Notes
8585
id: generate-release-notes
86-
uses: actions/github-script@v7
86+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
8787
with:
8888
script: |
8989
const { data: releaseNotes } = await github.rest.repos.generateReleaseNotes({

.github/workflows/generate-code.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313

1414
steps:
1515
- name: Setup
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1717
with:
1818
submodules: recursive
1919
- name: Update submodules
2020
run: git submodule update --remote --recursive
21-
- uses: actions/setup-node@v4
21+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
2222
- name: Set up Python
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
2424
with:
2525
python-version: '3.x'
2626
- name: Generate code

.github/workflows/publish-to-pypi.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
permissions:
1919
issues: write
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
with:
2323
submodules: true
2424
- name: Set up Python
25-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
2626
with:
2727
python-version: '3.x'
2828
- name: Install dependencies
@@ -45,14 +45,14 @@ jobs:
4545
python setup.py sdist bdist_wheel
4646
4747
- name: upload artifact
48-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4949
with:
5050
name: release-dists
5151
path: dist/
5252

5353
- name: Create GitHub Issue on Failure
5454
if: failure()
55-
uses: actions/github-script@v7
55+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
5656
with:
5757
script: |
5858
const { owner, repo } = context.repo;
@@ -81,7 +81,7 @@ jobs:
8181

8282
steps:
8383
- name: Retrieve release distributions
84-
uses: actions/download-artifact@v4
84+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
8585
with:
8686
name: release-dists
8787
path: dist/
@@ -91,7 +91,7 @@ jobs:
9191

9292
- name: Create GitHub Issue on Failure
9393
if: failure()
94-
uses: actions/github-script@v7
94+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
9595
with:
9696
script: |
9797
const { owner, repo } = context.repo;

renovate.json5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": [
4-
"config:recommended"
4+
"config:recommended",
5+
"helpers:pinGitHubActionDigestsToSemver"
56
],
67
"timezone": "Asia/Tokyo",
78
"automerge": true,

0 commit comments

Comments
 (0)