Skip to content

Commit 9ca6470

Browse files
authored
Merge branch 'master' into MaxymVlasov-patch-1
2 parents 1dc20a5 + 07ff497 commit 9ca6470

File tree

4 files changed

+123
-21
lines changed

4 files changed

+123
-21
lines changed

.github/workflows/build-image-test.yaml

+40-18
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,25 @@ env:
1313

1414
jobs:
1515
build:
16+
permissions:
17+
# for MaxymVlasov/dive-action to write comments to PRs
18+
pull-requests: write
19+
1620
strategy:
1721
matrix:
18-
os: [ubuntu-latest]
19-
arch: [amd64, arm64]
22+
arch:
23+
- amd64
24+
- arm64
25+
include:
26+
- os-name: Ubuntu x64
27+
os: ubuntu-latest
28+
arch: amd64
29+
30+
- os-name: Ubuntu ARM
31+
os: ubuntu-24.04-arm
32+
arch: arm64
2033

34+
name: ${{ matrix.os-name }}
2135
runs-on: ${{ matrix.os }}
2236
steps:
2337
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -37,21 +51,17 @@ jobs:
3751
tools/*.sh
3852
3953
- name: Set IMAGE environment variable
54+
if: steps.changed-files-specific.outputs.any_changed == 'true'
4055
# Lowercase the org/repo name to allow for workflow to run in forks,
4156
# which owners have uppercase letters in username
4257
run: >-
4358
echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY@L}:${{ env.IMAGE_TAG }}"
4459
>> $GITHUB_ENV
45-
- name: Set up QEMU
46-
if: matrix.os != 'ubuntu-latest' || matrix.arch != 'amd64'
47-
# yamllint disable-line rule:line-length
48-
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
49-
with:
50-
platforms: arm64
5160
5261
- name: Set up Docker Buildx
5362
# yamllint disable-line rule:line-length
5463
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
64+
if: steps.changed-files-specific.outputs.any_changed == 'true'
5565

5666
- name: Build if Dockerfile changed
5767
if: steps.changed-files-specific.outputs.any_changed == 'true'
@@ -61,9 +71,6 @@ jobs:
6171
context: .
6272
build-args: |
6373
INSTALL_ALL=true
64-
# yamllint disable-line rule:line-length
65-
platforms: >- # Only one allowed here, see https://github.com/docker/buildx/issues/59#issuecomment-1433097926
66-
linux/${{ matrix.arch }}
6774
push: false
6875
load: true
6976
tags: ${{ env.IMAGE }}
@@ -72,18 +79,34 @@ jobs:
7279
secrets: |
7380
"github_token=${{ secrets.GITHUB_TOKEN }}"
7481
82+
- name: Setup Container Structure Tests
83+
if: steps.changed-files-specific.outputs.any_changed == 'true'
84+
env:
85+
# yamllint disable-line rule:line-length
86+
# renovate: datasource=github-releases depName=container-structure-test lookupName=GoogleContainerTools/container-structure-test
87+
CST_VERSION: 1.19.3
88+
CST_REPO: github.com/GoogleContainerTools/container-structure-test
89+
run: >-
90+
curl -L "https://${{ env.CST_REPO }}/releases/download/v${{
91+
env.CST_VERSION }}/container-structure-test-linux-${{ matrix.arch }}"
92+
> container-structure-test
93+
&& chmod +x container-structure-test
94+
&& mkdir -p $HOME/bin/
95+
&& mv container-structure-test $HOME/bin/
96+
&& echo $HOME/bin/ >> $GITHUB_PATH
97+
7598
- name: Run structure tests
7699
if: steps.changed-files-specific.outputs.any_changed == 'true'
77-
# yamllint disable-line rule:line-length
78-
uses: plexsystems/container-structure-test-action@c0a028aa96e8e82ae35be556040340cbb3e280ca # v0.3.0
79-
with:
80-
image: ${{ env.IMAGE }}
81-
config: .github/.container-structure-test-config.yaml
100+
run: >-
101+
container-structure-test test
102+
--config ${{ github.workspace
103+
}}/.github/.container-structure-test-config.yaml
104+
--image ${{ env.IMAGE }}
82105
83106
- name: Dive - check image for waste files
84107
if: steps.changed-files-specific.outputs.any_changed == 'true'
85108
# yamllint disable-line rule:line-length
86-
uses: MaxymVlasov/dive-action@379af3fc636888ada5899c997e8b52db6ad45023 # v1.0.1
109+
uses: MaxymVlasov/dive-action@b6a02b38f0f309e8817199658eab090d4f0f93ce # v1.1.0
87110
with:
88111
image: ${{ env.IMAGE }}
89112
config-file: ${{ github.workspace }}/.github/.dive-ci.yaml
@@ -95,7 +118,6 @@ jobs:
95118
if: >-
96119
steps.changed-files-specific.outputs.any_changed == 'true'
97120
&& matrix.os == 'ubuntu-latest'
98-
&& matrix.arch == 'amd64'
99121
# yamllint disable-line rule:line-length
100122
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
101123
with:

.github/workflows/build-image.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323
steps:
2424
- name: Checkout code
2525
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26-
- name: Set up QEMU
27-
# yamllint disable-line rule:line-length
28-
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3.0
2926
- name: Set up Docker Buildx
3027
# yamllint disable-line rule:line-length
3128
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0

.github/workflows/codeql.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
# For most projects, this workflow file will not need changing; you simply need
3+
# to commit it to your repository.
4+
#
5+
# You may wish to alter this file to override the set of languages analyzed,
6+
# or to provide custom queries or build logic.
7+
#
8+
# ******** NOTE ********
9+
# We have attempted to detect the languages in your repository. Please check
10+
# the `language` matrix defined below to confirm you have the correct set of
11+
# supported CodeQL languages.
12+
#
13+
name: CodeQL
14+
15+
on:
16+
push:
17+
branches:
18+
- master
19+
pull_request:
20+
schedule:
21+
- cron: 0 0 * * 1
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
analyze:
28+
name: Analyze
29+
runs-on: ubuntu-latest
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
language:
39+
- python
40+
# CodeQL supports [ $supported-codeql-languages ]
41+
# Learn more about CodeQL language support at
42+
# https://aka.ms/codeql-docs/language-support
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
48+
# Initializes the CodeQL tools for scanning.
49+
- name: Initialize CodeQL
50+
# yamllint disable-line rule:line-length
51+
uses: github/codeql-action/init@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
52+
with:
53+
languages: ${{ matrix.language }}
54+
# If you wish to specify custom queries, you can do so here or in
55+
# a config file. # By default, queries listed here will override any
56+
# specified in a config file. Prefix the list here with "+" to use
57+
# these queries and those in the config file.
58+
59+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java)
60+
# If this step fails, then you should remove it and run the build
61+
# manually (see below)
62+
- name: Autobuild
63+
# yamllint disable-line rule:line-length
64+
uses: github/codeql-action/autobuild@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
65+
66+
# ℹ️ Command-line programs to run using the OS shell.
67+
# yamllint disable-line rule:line-length
68+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
69+
70+
# If the Autobuild fails above, remove it and uncomment the following
71+
# three lines. Modify them (or add more) to build your code if your
72+
# project, please refer to the EXAMPLE below for guidance.
73+
74+
# - run: |
75+
# echo "Run, Build Application using script"
76+
# ./location_of_script_within_repo/buildscript.sh
77+
78+
- name: Perform CodeQL Analysis
79+
# yamllint disable-line rule:line-length
80+
uses: github/codeql-action/analyze@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
81+
with:
82+
category: /language:${{matrix.language}}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Github tag](https://img.shields.io/github/tag/antonbabenko/pre-commit-terraform.svg)](https://github.com/antonbabenko/pre-commit-terraform/releases) ![maintenance status](https://img.shields.io/maintenance/yes/2025.svg) [![Help Contribute to Open Source](https://www.codetriage.com/antonbabenko/pre-commit-terraform/badges/users.svg)](https://www.codetriage.com/antonbabenko/pre-commit-terraform)
44
[![CI/CD Badge]][CI/CD]
55
[![Codecov Badge]][Codecov]
6+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/antonbabenko/pre-commit-terraform/badge)](https://scorecard.dev/viewer/?uri=github.com/antonbabenko/pre-commit-terraform)
67
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9963/badge)](https://www.bestpractices.dev/projects/9963)
78

89
[CI/CD Badge]:

0 commit comments

Comments
 (0)