Skip to content

Commit

Permalink
Actionsのバージョンをコミットハッシュで固定する (#1587)
Browse files Browse the repository at this point in the history
* Pin dependencies

* super-linterのバージョン取得処理修正

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
massongit and renovate[bot] authored Oct 16, 2024
1 parent 38a7854 commit 05b3c90
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/add-to-task-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Generate a token
id: generate_token
uses: actions/[email protected]
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -56,7 +56,7 @@ jobs:
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

uses: github/codeql-action/autobuild@v3
uses: github/codeql-action/autobuild@f779452ac5af1c261dce0346a8f964149f49322b # v3
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
Expand All @@ -66,6 +66,6 @@ jobs:

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: ./
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format-json-yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
steps:
- name: Generate a token
id: generate_token
uses: actions/[email protected]
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
- uses: actions/[email protected]
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-cache-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
github-actions-cache-cleaner:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: dev-hato/github-actions-cache-cleaner@223f86272059b9654c86deb72176cc3a484668fb # v0.0.55
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/[email protected]
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
# Full git history is needed to get a proper list
# of changed files within `super-linter`
fetch-depth: 0
- uses: actions/[email protected]
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
cache: npm
- run: bash "${GITHUB_WORKSPACE}/scripts/super_linter/build/set_path.sh"
################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: super-linter/super-linter/[email protected]
uses: super-linter/super-linter/slim@b92721f792f381cedc002ecdbb9847a15ece5bb8 # v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: main
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-gitleaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
update-gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/[email protected]
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
cache: npm
- name: Install packages
if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: npm ci
- uses: dev-hato/[email protected]
- uses: dev-hato/actions-update-gitleaks@0e9a2d1c25c0acc3108157714109d94ebecbf7cf # v0.0.79
with:
github-token: ${{secrets.GITHUB_TOKEN}}
concurrency:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
update-package:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/[email protected]
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
cache: npm
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: npm install
- uses: dev-hato/[email protected]
- uses: dev-hato/actions-diff-pr-management@e5c78b251a69f44f93b2f1398e06b129bcf151ec # v1.2.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
branch-name-prefix: fix-package
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ runs:
steps:
- name: Increment version
id: increment_version
uses: actions/[email protected]
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
SHA: ${{ github.sha }}
with:
Expand All @@ -20,7 +20,7 @@ runs:
const script = require('${{ github.action_path }}/scripts/action/increment_version.js')
return await script({github, context})
- name: Create release
uses: actions/[email protected]
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
GITHUB_REF: ${{env.GITHUB_REF}}
TAG_NAME: ${{ steps.increment_version.outputs.result }}
Expand Down
5 changes: 3 additions & 2 deletions scripts/super_linter/build/set_path.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

npm ci
action="$(yq '.jobs.build.steps[-1].uses' .github/workflows/super-linter.yml)"
PATH="$(docker run --rm --entrypoint '' "ghcr.io/${action//\/slim@/:slim-}" /bin/sh -c 'echo $PATH')"
tag_name="$(yq '.jobs.build.steps[-1].uses' .github/workflows/super-linter.yml | sed -e 's;/slim@.*;:slim;g')"
tag_version="$(yq '.jobs.build.steps[-1].uses | line_comment' .github/workflows/super-linter.yml)"
PATH="$(docker run --rm --entrypoint '' "ghcr.io/${tag_name}-${tag_version}" /bin/sh -c 'echo $PATH')"
echo "PATH=/github/workspace/node_modules/.bin:${PATH}" >>"$GITHUB_ENV"

0 comments on commit 05b3c90

Please sign in to comment.