Skip to content

Commit beb50c2

Browse files
Merge pull request #519 from RalphHightower/RalphHightower-patch-24
[improve](build): standardize workflows
2 parents 5611abc + 07605f4 commit beb50c2

File tree

12 files changed

+463
-24
lines changed

12 files changed

+463
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ci.yml – Continuous Integration
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: "Test with Jekyll ${{ matrix.jekyll }}"
15+
runs-on: "ubuntu-latest"
16+
strategy:
17+
matrix:
18+
jekyll: ["~> 4.3.4"]
19+
env:
20+
JEKYLL_VERSION: ${{ matrix.jekyll }}
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/[email protected]
24+
- name: Set Up Ruby 3.3.6
25+
uses: ruby/[email protected]
26+
with:
27+
ruby-version: 3.3.6
28+
bundler-cache: true
29+
- name: Run tests
30+
run: script/cibuild

.github/workflows/codeql.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: ["main"]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: ["main"]
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: ["ruby"]
39+
# CodeQL supports [ $supported-codeql-languages ]
40+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/[email protected]
45+
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/[email protected]
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
55+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
56+
# If this step fails, then you should remove it and run the build manually (see below)
57+
- name: Autobuild
58+
uses: github/codeql-action/[email protected]
59+
60+
# ℹ️ Command-line programs to run using the OS shell.
61+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
62+
63+
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
65+
66+
# - run: |
67+
# echo "Run, Build Application using script"
68+
# ./location_of_script_within_repo/buildscript.sh
69+
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/[email protected]
72+
with:
73+
category: "/language:${{matrix.language}}"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'dependency – Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 'Checkout Repository'
20+
uses: actions/[email protected]
21+
- name: 'Dependency Review'
22+
uses: actions/[email protected]

.github/workflows/jekyll.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Checkout
3535
uses: actions/[email protected]
3636
- name: Setup Ruby
37-
uses: ruby/setup-ruby@v1.202.0
37+
uses: ruby/setup-ruby@v1.203.0
3838
with:
3939
ruby-version: '3.3.6' # Not needed with a .ruby-version file
4040
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
@@ -44,7 +44,7 @@ jobs:
4444
uses: actions/[email protected]
4545
- name: Build with Jekyll
4646
# Outputs to the './_site' directory by default
47-
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
47+
run: bundle exec jekyll build --trace --incremental --baseurl "${{ steps.pages.outputs.base_path }}"
4848
env:
4949
JEKYLL_ENV: production
5050
JEKYLL_GITHUB_TOKEN: ${{secrets.JEKYLL_METADATA_TOKEN}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Sample workflow to run the action
2+
name: permission_advisor.yml — Permissions Advisor
3+
4+
permissions:
5+
actions: read
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
name:
11+
description: 'The name of the workflow file to analyze'
12+
required: true
13+
type: string
14+
count:
15+
description: 'How many last runs to analyze'
16+
required: false
17+
type: number
18+
default: 10
19+
20+
jobs:
21+
advisor:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: GitHubSecurityLab/actions-permissions/[email protected]
25+
with:
26+
name: ${{ inputs.name }}
27+
count: ${{ inputs.count }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: readme-checker.yml – Checks for suggested markdown
2+
on: [push, pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: Checking markdown
14+
uses: DavidAnson/[email protected]
15+
with:
16+
globs: |
17+
*.md
18+
**/*.md
19+
!test/*.md

.github/workflows/release-please.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
name: release-please.yml – Automate releases with Conventional Commit Messages.
12
on:
23
push:
34
branches:
45
- main
56

67
permissions:
7-
contents: write
88
pull-requests: write
99

1010
name: release-please
@@ -13,8 +13,9 @@ jobs:
1313
release-please:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: googleapis/release-please-action@v4.1.3
16+
- uses: googleapis/release-please-action@4.1.3
1717
with:
18+
contents: write
1819
# this assumes that you have created a personal access token
1920
# (PAT) and configured it as a GitHub action secret named
2021
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).

.github/workflows/release.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1-
name: release.yml — Copied from docs/recipes/ci-configurations/github-actions.md)
1+
name: release.yml – Release
22
on:
33
push:
4-
branches: ["main", "_staging", "next", "master"]
5-
4+
branches:
5+
- main
6+
- next
7+
- beta
8+
- "*.x"
69
permissions:
710
contents: read # for checkout
8-
911
jobs:
1012
release:
11-
name: Release
12-
runs-on: ubuntu-latest
1313
permissions:
1414
contents: write # to be able to publish a GitHub release
1515
issues: write # to be able to comment on released issues
1616
pull-requests: write # to be able to comment on released pull requests
1717
id-token: write # to enable use of OIDC for npm provenance
18+
name: release
19+
runs-on: ubuntu-latest
1820
steps:
19-
- name: Checkout
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
- name: Setup Node.js
24-
uses: actions/[email protected]
21+
- uses: actions/[email protected]
22+
- uses: actions/[email protected]
2523
with:
26-
node-version: "lts/*"
27-
- name: Install dependencies
28-
run: npm clean-install
29-
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
30-
run: npm audit signatures
31-
- name: Release
24+
cache: npm
25+
node-version: lts/*
26+
- run: npm clean-install
27+
- run: corepack npm audit signatures
28+
# pinned version updated automatically by Renovate.
29+
# details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation
30+
- run: npx [email protected]
3231
env:
3332
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # was NPM_TOKEN 2024-11-05 @@RalphHightower
35-
run: npx semantic-release
33+
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }}

.github/workflows/scorecard.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: scorecard.yml — OpenSSF Scorecard
2+
"on":
3+
schedule:
4+
- cron: 31 2 * * 1
5+
push:
6+
branches:
7+
- main
8+
permissions: read-all
9+
jobs:
10+
analysis:
11+
name: Scorecard analysis
12+
runs-on: ubuntu-latest
13+
permissions:
14+
security-events: write
15+
id-token: write
16+
steps:
17+
- name: Checkout code
18+
uses: actions/[email protected]
19+
with:
20+
persist-credentials: false
21+
- name: Run analysis
22+
uses: ossf/[email protected]
23+
with:
24+
results_file: results.sarif
25+
results_format: sarif
26+
publish_results: true
27+
- name: Upload artifact
28+
uses: actions/[email protected]
29+
with:
30+
name: SARIF file
31+
path: results.sarif
32+
retention-days: 5
33+
- name: Upload to code-scanning
34+
uses: github/codeql-action/[email protected]
35+
with:
36+
sarif_file: results.sarif

0 commit comments

Comments
 (0)