Skip to content

Commit 1d44e2b

Browse files
authored
Update workflows (#1072)
1 parent 3b40f0f commit 1d44e2b

File tree

6 files changed

+55
-46
lines changed

6 files changed

+55
-46
lines changed

.github/workflows/ci.yml

+5-10
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ on:
1111
branches:
1212
- main
1313
- release-*
14-
types:
15-
- opened
16-
- reopened
17-
- synchronize
1814

1915
defaults:
2016
run:
@@ -121,7 +117,7 @@ jobs:
121117
with:
122118
minor-label: "enhancement"
123119
major-label: "change"
124-
publish: ${{ startsWith(github.ref, 'refs/tags/') }}
120+
publish: ${{ github.ref_type == 'tag' }}
125121
collapse-after: 20
126122
notes-header: |
127123
*Below is the auto-generated changelog, which includes all PRs that went into the release.
@@ -130,17 +126,17 @@ jobs:
130126

131127
- name: Download Syft
132128
uses: anchore/sbom-action/download-syft@78fc58e266e87a38d4194b2137a3d4e9bcaf7ca1 # v0.14.3
133-
if: startsWith(github.ref, 'refs/tags/')
129+
if: github.ref_type == 'tag'
134130

135131
- name: Install Cosign
136132
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2
137-
if: startsWith(github.ref, 'refs/tags/')
133+
if: github.ref_type == 'tag'
138134

139135
- name: Build binary
140136
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
141137
with:
142138
version: latest
143-
args: ${{ startsWith(github.ref, 'refs/tags/') && 'release' || 'build --snapshot' }} --clean
139+
args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} --clean
144140
env:
145141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146142
GOPATH: ${{ needs.vars.outputs.go_path }}
@@ -320,7 +316,6 @@ jobs:
320316
NJS_DIR=internal/mode/static/nginx/modules/src
321317
NGINX_CONF_DIR=internal/mode/static/nginx/conf
322318
323-
324319
- name: Run Trivy vulnerability scanner
325320
uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # 0.12.0
326321
continue-on-error: true
@@ -366,7 +361,7 @@ jobs:
366361
- name: Package
367362
id: package
368363
run: |
369-
output=$(helm package ${{ ! startsWith(github.ref, 'refs/tags/') && '--app-version edge --version 0.0.0-edge' || '' }} deploy/helm-chart)
364+
output=$(helm package ${{ github.ref_type != 'tag' && '--app-version edge --version 0.0.0-edge' || '' }} deploy/helm-chart)
370365
echo "path=$(basename -- $(echo $output | cut -d: -f2))" >> $GITHUB_OUTPUT
371366
372367
- name: Push to GitHub Container Registry

.github/workflows/codeql-analysis.yml

+26-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- main
1212
- release-*
1313
schedule:
14-
- cron: "39 13 * * 6"
14+
- cron: "39 13 * * 6" # run every Saturday at 13:39 UTC
1515

1616
concurrency:
1717
group: ${{ github.ref_name }}-codeql
@@ -22,19 +22,21 @@ permissions:
2222

2323
jobs:
2424
analyze:
25+
permissions:
26+
actions: read # for github/codeql-action/init to get workflow details
27+
contents: read # for actions/checkout to fetch code
28+
security-events: write # for github/codeql-action/autobuild to send a status report
2529
name: Analyze
2630
runs-on: ubuntu-22.04
27-
permissions:
28-
actions: read
29-
contents: read
30-
security-events: write
3131

3232
strategy:
3333
fail-fast: false
3434
matrix:
3535
language: ["go", "javascript"]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
37+
# Use only 'java' to analyze code written in Java, Kotlin or both
38+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3840

3941
steps:
4042
- name: Checkout repository
@@ -48,23 +50,32 @@ jobs:
4850
# If you wish to specify custom queries, you can do so here or in a config file.
4951
# By default, queries listed here will override any specified in a config file.
5052
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5253

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# 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
55+
# queries: security-extended,security-and-quality
56+
57+
- name: Setup Golang Environment
58+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
59+
with:
60+
go-version-file: go.mod
61+
if: matrix.language == 'go'
62+
63+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
5464
# If this step fails, then you should remove it and run the build manually (see below)
5565
- name: Autobuild
5666
uses: github/codeql-action/autobuild@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
5767

5868
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
69+
# 📚 See https://docs.github.com./en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6070

61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
71+
# If the Autobuild fails above, remove it and uncomment the following three lines.
72+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6473

6574
# - run: |
66-
# make bootstrap
67-
# make release
75+
# echo "Run, Build Application using script"
76+
# ./location_of_script_within_repo/buildscript.sh
6877

6978
- name: Perform CodeQL Analysis
7079
uses: github/codeql-action/analyze@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
80+
with:
81+
category: "/language:${{matrix.language}}"

.github/workflows/conformance.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ on:
1111
branches:
1212
- main
1313
- release-*
14-
types:
15-
- opened
16-
- reopened
17-
- synchronize
1814
schedule:
19-
- cron: '0 4 * * *'
15+
- cron: "0 4 * * *" # run every day at 4am UTC
2016

2117
concurrency:
2218
group: ${{ github.ref_name }}-conformance

.github/workflows/fossa.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
steps:
2121
- name: Checkout Repository
2222
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
23+
2324
- name: Scan
2425
uses: fossas/fossa-action@f61a4c0c263690f2ddb54b9822a719c25a7b608f # v1.3.1
2526
with:

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- uses: DavidAnson/markdownlint-cli2-action@3aaa38e446fbd2c288af4291aa0f55d64651050f # v12.0.0
8888
with:
8989
config: ${{ github.workspace }}/.markdownlint-cli2.yaml
90-
globs: '**/*.md'
90+
globs: "**/*.md"
9191

9292
chart-lint:
9393
name: Chart Lint

.github/workflows/scorecards.yml

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1-
name: Scorecards supply-chain security
1+
name: OpenSSF Scorecard
22
on:
3-
# Only the default branch is supported.
4-
branch_protection_rule:
5-
types: [created, edited, deleted]
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com./ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule: # yamllint disable-line rule:empty-values
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com./ossf/scorecard/blob/main/docs/checks.md#maintained
68
schedule:
7-
- cron: "27 5 * * 0"
9+
- cron: "27 5 * * 0" # run every Sunday at 5:27 AM UTC
810
push:
9-
branches: ["main"]
11+
branches:
12+
- main
1013

1114
# Declare default permissions as read only.
1215
permissions: read-all
1316

1417
jobs:
1518
analysis:
16-
name: Scorecards analysis
19+
name: Scorecard analysis
1720
runs-on: ubuntu-22.04
1821
permissions:
1922
# Needed to upload the results to code-scanning dashboard.
2023
security-events: write
21-
# Used to receive a badge.
24+
# Needed to publish results and get a badge (see publish_results below).
2225
id-token: write
23-
# Needs for private repositories.
24-
contents: read
25-
actions: read
26+
# Uncomment the permissions below if installing in a private repository.
27+
# contents: read
28+
# actions: read
2629

2730
steps:
2831
- name: "Checkout code"
@@ -37,10 +40,13 @@ jobs:
3740
results_format: sarif
3841
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
3942

40-
# Publish the results for public repositories to enable scorecard badges. For more details, see
41-
# https://github.com./ossf/scorecard-action#publishing-results.
42-
# For private repositories, `publish_results` will automatically be set to `false`, regardless
43-
# of the value entered here.
43+
# Public repositories:
44+
# - Publish results to OpenSSF REST API for easy access by consumers
45+
# - Allows the repository to include the Scorecard badge.
46+
# - See https://github.com./ossf/scorecard-action#publishing-results.
47+
# For private repositories:
48+
# - `publish_results` will always be set to `false`, regardless
49+
# of the value entered here.
4450
publish_results: true
4551

4652
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF

0 commit comments

Comments
 (0)