mirror of
https://github.com/storytold/craft-common-actions.git
synced 2026-11-19 08:55:36 +00:00
Merge branch 'main' into sonar/docker-build-job-permissions
This commit is contained in:
25 files changed
+365
-10
No files matched your search
@@ -35,6 +35,15 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
api.github.com:443
|
||||
github.com:443
|
||||
objects.githubusercontent.com:443
|
||||
release-assets.githubusercontent.com:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -45,6 +45,10 @@ jobs:
|
||||
matched: ${{ steps.match.outputs.matched }}
|
||||
reason: ${{ steps.match.outputs.reason }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
# Two commits deep for the merge commit's first parent; trees only, no file contents.
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
|
||||
@@ -110,6 +110,10 @@ jobs:
|
||||
runs-on: ${{ matrix.platform.runner }}
|
||||
timeout-minutes: ${{ inputs.timeout-minutes }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- name: Check out
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
@@ -252,6 +256,10 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
|
||||
@@ -34,6 +34,10 @@ jobs:
|
||||
- { arch: x86_64, runner: ubuntu-24.04 }
|
||||
- { arch: aarch64, runner: ubuntu-24.04-arm }
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
|
||||
@@ -71,6 +71,10 @@ jobs:
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_BUILD_JOBS: 4
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Check out craft-fonts
|
||||
if: inputs.craft-fonts-ref != ''
|
||||
@@ -102,6 +106,19 @@ jobs:
|
||||
prepare: |
|
||||
# Keep rustup/proxies outside the Cargo data cache.
|
||||
unset CARGO_HOME CARGO_TARGET_DIR
|
||||
# A large test crate's rustc (photocraft-ui-egui's lib tests) was SIGKILLed when the
|
||||
# 12 GB guest ran out of memory late in a run: the image's root is ZFS with no ARC
|
||||
# limit, so the ARC kept the target dir's pages. Cap it. (No swap file: swap on a
|
||||
# ZFS-backed file can hang FreeBSD under memory pressure; the image has a 1 GB swap
|
||||
# partition.) Print disk, swap and memory so the next OOM is easy to diagnose.
|
||||
if [ "$(uname -s)" = FreeBSD ]; then
|
||||
if sysctl -n vfs.zfs.arc_max >/dev/null 2>&1; then
|
||||
sysctl vfs.zfs.arc_max=2147483648 || echo "::warning::could not cap the ZFS ARC"
|
||||
fi
|
||||
df -h / /var/tmp || true
|
||||
swapctl -l || true
|
||||
sysctl -n hw.physmem || true
|
||||
fi
|
||||
if [ "${{ matrix.arch }}" = aarch64 ]; then
|
||||
# The host compiler and the aarch64 standard library come from the amd64 and
|
||||
# aarch64 lang/rust packages, which must be the same build. "latest" can build
|
||||
|
||||
@@ -118,6 +118,10 @@ jobs:
|
||||
CARGO_NET_RETRY: 10
|
||||
RUST_BACKTRACE: 1
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -27,6 +27,10 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -30,6 +30,13 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
api.github.com:443
|
||||
github.com:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -18,6 +18,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23
|
||||
- name: Check flake evaluation
|
||||
|
||||
@@ -19,6 +19,28 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
*.github.com:443
|
||||
*.githubusercontent.com:443
|
||||
*.microsoft.com:443
|
||||
*.ubuntu.com:80
|
||||
*.ubuntu.com:443
|
||||
api.github.com:443
|
||||
archive.ubuntu.com:80
|
||||
archive.ubuntu.com:443
|
||||
azure.archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:443
|
||||
github.com:443
|
||||
objects.githubusercontent.com:443
|
||||
packages.microsoft.com:443
|
||||
release-assets.githubusercontent.com:443
|
||||
security.ubuntu.com:80
|
||||
security.ubuntu.com:443
|
||||
security.ubuntu.com:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Run packaging lint
|
||||
uses: storytold/craft-common-actions/actions/packaging-lint@main
|
||||
|
||||
@@ -18,6 +18,10 @@ jobs:
|
||||
outputs:
|
||||
artifact-name: contributor-snapshot-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -148,6 +148,10 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Git dependencies come from storytold
|
||||
run: |
|
||||
@@ -191,6 +195,10 @@ jobs:
|
||||
date: ${{ steps.v.outputs.date }}
|
||||
prerelease: ${{ steps.v.outputs.prerelease }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- id: v
|
||||
name: Resolve version
|
||||
@@ -214,6 +222,10 @@ jobs:
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
# A signed job reads only the secrets the caller lists in its `secrets:` block; values come
|
||||
# from the repo's `release` environment. An unlisted name is empty, and the app's packaging
|
||||
# would then warn and ship unsigned, so on the release branch fail here instead.
|
||||
@@ -334,6 +346,10 @@ jobs:
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
# See the macOS job: unlisted secrets are empty, and the build would ship unsigned.
|
||||
# Signing needs either the PFX pair or all six Azure Trusted Signing values.
|
||||
- name: Require signing secrets on the release branch
|
||||
@@ -439,6 +455,10 @@ jobs:
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Load refreshed contributor credits
|
||||
if: inputs.contributors-artifact != ''
|
||||
@@ -532,6 +552,10 @@ jobs:
|
||||
BUILD_DATE: ${{ needs.version.outputs.date }}
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Export the app's build variables
|
||||
id: app-env
|
||||
@@ -649,6 +673,10 @@ jobs:
|
||||
matrix:
|
||||
arch: [x86_64, aarch64]
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
@@ -708,6 +736,10 @@ jobs:
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- name: Check the FreeBSD architecture
|
||||
env:
|
||||
ARCH: ${{ matrix.arch }}
|
||||
@@ -937,6 +969,10 @@ jobs:
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Load refreshed contributor credits
|
||||
if: inputs.contributors-artifact != ''
|
||||
@@ -1009,6 +1045,10 @@ jobs:
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Load refreshed contributor credits
|
||||
if: inputs.contributors-artifact != ''
|
||||
@@ -1103,6 +1143,10 @@ jobs:
|
||||
BUILD_DATE: ${{ needs.version.outputs.date }}
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Load refreshed contributor credits
|
||||
if: inputs.contributors-artifact != ''
|
||||
@@ -1154,6 +1198,10 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: storytold/craft-common-actions/actions/draft-release@main
|
||||
with:
|
||||
version: ${{ needs.version.outputs.version }}
|
||||
|
||||
@@ -66,6 +66,46 @@ jobs:
|
||||
outputs:
|
||||
matrix: ${{ steps.matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
*.amazonaws.com:443
|
||||
*.crates.io:443
|
||||
*.s3.amazonaws.com:443
|
||||
*.s3.eu-central-1.amazonaws.com:443
|
||||
*.github.com:443
|
||||
*.githubusercontent.com:443
|
||||
*.microsoft.com:443
|
||||
*.openpgp.org:443
|
||||
*.pythonhosted.org:443
|
||||
*.sonarcloud.io:443
|
||||
*.sonarsource.com:443
|
||||
*.ubuntu.com:80
|
||||
*.ubuntu.com:443
|
||||
api.github.com:443
|
||||
archive.ubuntu.com:80
|
||||
archive.ubuntu.com:443
|
||||
azure.archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:443
|
||||
binaries.sonarsource.com:443
|
||||
crates.io:443
|
||||
files.pythonhosted.org:443
|
||||
github.com:443
|
||||
index.crates.io:443
|
||||
keys.openpgp.org:443
|
||||
keyserver.ubuntu.com:443
|
||||
objects.githubusercontent.com:443
|
||||
packages.microsoft.com:443
|
||||
pypi.org:443
|
||||
release-assets.githubusercontent.com:443
|
||||
scanner.sonarcloud.io:443
|
||||
security.ubuntu.com:80
|
||||
security.ubuntu.com:443
|
||||
sonarcloud.io:443
|
||||
static.crates.io:443
|
||||
static.rust-lang.org:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
@@ -97,6 +137,46 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: ${{ inputs.timeout-minutes }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
*.amazonaws.com:443
|
||||
*.crates.io:443
|
||||
*.s3.amazonaws.com:443
|
||||
*.s3.eu-central-1.amazonaws.com:443
|
||||
*.github.com:443
|
||||
*.githubusercontent.com:443
|
||||
*.microsoft.com:443
|
||||
*.openpgp.org:443
|
||||
*.pythonhosted.org:443
|
||||
*.sonarcloud.io:443
|
||||
*.sonarsource.com:443
|
||||
*.ubuntu.com:80
|
||||
*.ubuntu.com:443
|
||||
api.github.com:443
|
||||
archive.ubuntu.com:80
|
||||
archive.ubuntu.com:443
|
||||
azure.archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:443
|
||||
binaries.sonarsource.com:443
|
||||
crates.io:443
|
||||
files.pythonhosted.org:443
|
||||
github.com:443
|
||||
index.crates.io:443
|
||||
keys.openpgp.org:443
|
||||
keyserver.ubuntu.com:443
|
||||
objects.githubusercontent.com:443
|
||||
packages.microsoft.com:443
|
||||
pypi.org:443
|
||||
release-assets.githubusercontent.com:443
|
||||
scanner.sonarcloud.io:443
|
||||
security.ubuntu.com:80
|
||||
security.ubuntu.com:443
|
||||
sonarcloud.io:443
|
||||
static.crates.io:443
|
||||
static.rust-lang.org:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
@@ -168,6 +248,46 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
*.amazonaws.com:443
|
||||
*.crates.io:443
|
||||
*.s3.amazonaws.com:443
|
||||
*.s3.eu-central-1.amazonaws.com:443
|
||||
*.github.com:443
|
||||
*.githubusercontent.com:443
|
||||
*.microsoft.com:443
|
||||
*.openpgp.org:443
|
||||
*.pythonhosted.org:443
|
||||
*.sonarcloud.io:443
|
||||
*.sonarsource.com:443
|
||||
*.ubuntu.com:80
|
||||
*.ubuntu.com:443
|
||||
api.github.com:443
|
||||
archive.ubuntu.com:80
|
||||
archive.ubuntu.com:443
|
||||
azure.archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:443
|
||||
binaries.sonarsource.com:443
|
||||
crates.io:443
|
||||
files.pythonhosted.org:443
|
||||
github.com:443
|
||||
index.crates.io:443
|
||||
keys.openpgp.org:443
|
||||
keyserver.ubuntu.com:443
|
||||
objects.githubusercontent.com:443
|
||||
packages.microsoft.com:443
|
||||
pypi.org:443
|
||||
release-assets.githubusercontent.com:443
|
||||
scanner.sonarcloud.io:443
|
||||
security.ubuntu.com:80
|
||||
security.ubuntu.com:443
|
||||
sonarcloud.io:443
|
||||
static.crates.io:443
|
||||
static.rust-lang.org:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
@@ -239,6 +359,46 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: ${{ inputs.timeout-minutes }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
*.amazonaws.com:443
|
||||
*.crates.io:443
|
||||
*.s3.amazonaws.com:443
|
||||
*.s3.eu-central-1.amazonaws.com:443
|
||||
*.github.com:443
|
||||
*.githubusercontent.com:443
|
||||
*.microsoft.com:443
|
||||
*.openpgp.org:443
|
||||
*.pythonhosted.org:443
|
||||
*.sonarcloud.io:443
|
||||
*.sonarsource.com:443
|
||||
*.ubuntu.com:80
|
||||
*.ubuntu.com:443
|
||||
api.github.com:443
|
||||
archive.ubuntu.com:80
|
||||
archive.ubuntu.com:443
|
||||
azure.archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:443
|
||||
binaries.sonarsource.com:443
|
||||
crates.io:443
|
||||
files.pythonhosted.org:443
|
||||
github.com:443
|
||||
index.crates.io:443
|
||||
keys.openpgp.org:443
|
||||
keyserver.ubuntu.com:443
|
||||
objects.githubusercontent.com:443
|
||||
packages.microsoft.com:443
|
||||
pypi.org:443
|
||||
release-assets.githubusercontent.com:443
|
||||
scanner.sonarcloud.io:443
|
||||
security.ubuntu.com:80
|
||||
security.ubuntu.com:443
|
||||
sonarcloud.io:443
|
||||
static.crates.io:443
|
||||
static.rust-lang.org:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -22,6 +22,10 @@ jobs:
|
||||
attestations: write
|
||||
artifact-metadata: write
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- name: Download release artifacts
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
@@ -49,7 +53,7 @@ jobs:
|
||||
done < "$PWD/release-files"
|
||||
|
||||
- name: Generate the CycloneDX SBOM
|
||||
uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3
|
||||
uses: step-security/sbom-action@28bb7d0d2869c9ab0e5571c93591747945819d39 # v0.24.2
|
||||
with:
|
||||
path: subjects
|
||||
format: cyclonedx-json
|
||||
|
||||
@@ -22,6 +22,15 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
api.github.com:443
|
||||
github.com:443
|
||||
objects.githubusercontent.com:443
|
||||
release-assets.githubusercontent.com:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -23,6 +23,21 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
api.github.com:443
|
||||
github.com:443
|
||||
archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:443
|
||||
packages.microsoft.com:443
|
||||
security.ubuntu.com:80
|
||||
archive.ubuntu.com:443
|
||||
azure.archive.ubuntu.com:443
|
||||
security.ubuntu.com:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install YAML parser
|
||||
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-yaml tcsh rpm debsigs dpkg-dev skopeo
|
||||
|
||||
@@ -24,6 +24,13 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
api.github.com:443
|
||||
github.com:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@@ -20,6 +20,21 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: block
|
||||
allowed-endpoints: >
|
||||
api.github.com:443
|
||||
github.com:443
|
||||
archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:80
|
||||
azure.archive.ubuntu.com:443
|
||||
packages.microsoft.com:443
|
||||
security.ubuntu.com:80
|
||||
archive.ubuntu.com:443
|
||||
azure.archive.ubuntu.com:443
|
||||
security.ubuntu.com:443
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Install packages
|
||||
uses: ./actions/install-apt-packages
|
||||
|
||||
@@ -55,6 +55,10 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Check out craft-i18n
|
||||
uses: storytold/craft-common-actions/actions/checkout-craft-i18n@main
|
||||
@@ -91,6 +95,10 @@ jobs:
|
||||
runs-on: windows-11-arm
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: ${{ inputs.app-name }}-windows-arm64
|
||||
|
||||
@@ -62,7 +62,7 @@ class ChangedPathsTests(unittest.TestCase):
|
||||
self.assertNotIn('${{', MATCH['run'])
|
||||
|
||||
def test_checkout_is_pinned_and_keeps_no_credentials(self):
|
||||
checkout = STEPS[0]
|
||||
checkout = next(s for s in STEPS if s.get('uses', '').startswith('actions/checkout@'))
|
||||
self.assertRegex(checkout['uses'], r'^actions/checkout@[0-9a-f]{40}$')
|
||||
self.assertEqual(checkout['with']['persist-credentials'], 'false')
|
||||
self.assertEqual(checkout['with']['fetch-depth'], '2')
|
||||
|
||||
@@ -167,7 +167,8 @@ class CheckGitSourcesWiringTests(unittest.TestCase):
|
||||
job = WORKFLOW["jobs"]["git-sources"]
|
||||
self.assertEqual(WORKFLOW["permissions"], {"contents": "read"})
|
||||
self.assertIn("timeout-minutes", job)
|
||||
checkout, check = job["steps"]
|
||||
steps = [s for s in job["steps"] if s.get("name") != "Harden runner"]
|
||||
checkout, check = steps
|
||||
self.assertTrue(checkout["uses"].startswith("actions/checkout@"))
|
||||
self.assertEqual(checkout["with"]["persist-credentials"], "false")
|
||||
self.assertEqual(check["uses"], "storytold/craft-common-actions/actions/check-git-sources@main")
|
||||
|
||||
@@ -81,7 +81,7 @@ Path('contributors/contributors.json').write_text(json.dumps(credits))
|
||||
"""Keep refresh read-only and publish the validated file under its output name."""
|
||||
workflow = load('refresh-contributors.yml')
|
||||
self.assertEqual(workflow['permissions'], {'contents': 'read', 'pull-requests': 'read'})
|
||||
steps = workflow['jobs']['refresh']['steps']
|
||||
steps = [s for s in workflow['jobs']['refresh']['steps'] if s.get('name') != 'Harden runner']
|
||||
checkout = steps[0]
|
||||
self.assertEqual(checkout['with']['fetch-depth'], '0')
|
||||
self.assertEqual(checkout['with']['persist-credentials'], 'false')
|
||||
@@ -97,7 +97,7 @@ Path('contributors/contributors.json').write_text(json.dumps(credits))
|
||||
|
||||
def test_generator_is_shared_and_paired_with_the_workflow_revision(self):
|
||||
"""Pinned and forked workflows select their own generator, with literal path arguments."""
|
||||
steps = load('refresh-contributors.yml')['jobs']['refresh']['steps']
|
||||
steps = [s for s in load('refresh-contributors.yml')['jobs']['refresh']['steps'] if s.get('name') != 'Harden runner']
|
||||
self.assertEqual(steps[1]['uses'], '$/actions/refresh-contributors')
|
||||
action = shared_action()['runs']['steps'][0]
|
||||
self.assertEqual(action['env']['GENERATOR_PATH'], '${{ github.action_path }}/refresh_contributors.py')
|
||||
|
||||
@@ -389,7 +389,7 @@ fi
|
||||
def test_release_workflow_rejects_unsupported_architectures_before_the_vm(self):
|
||||
release = yaml.load((ROOT / ".github/workflows/release.yml").read_text(), Loader=yaml.BaseLoader)
|
||||
steps = release["jobs"]["freebsd"]["steps"]
|
||||
check = steps[0]
|
||||
check = next(step for step in steps if step.get("name") == "Check the FreeBSD architecture")
|
||||
self.assertEqual(check["name"], "Check the FreeBSD architecture")
|
||||
self.assertEqual(check["env"]["ARCH"], "${{ matrix.arch }}")
|
||||
for arch, code in (("x86_64", 0), ("aarch64", 0), ("riscv64", 1), ("amd64", 1), ("", 1)):
|
||||
|
||||
@@ -166,7 +166,8 @@ class HouseRulesWiringTests(unittest.TestCase):
|
||||
job = workflow["jobs"]["house-rules"]
|
||||
self.assertEqual(workflow["permissions"], {"contents": "read"})
|
||||
self.assertIn("timeout-minutes", job)
|
||||
app, source, check = job["steps"]
|
||||
steps = [s for s in job["steps"] if s.get("name") != "Harden runner"]
|
||||
app, source, check = steps
|
||||
self.assertTrue(app["uses"].startswith("actions/checkout@"))
|
||||
self.assertEqual(app["with"]["persist-credentials"], "false")
|
||||
self.assertEqual(source["with"]["repository"], "storytold/craft-contrib")
|
||||
|
||||
@@ -50,8 +50,8 @@ class SupplyChainOptInTests(unittest.TestCase):
|
||||
self.assertEqual(permissions["contents"], "write")
|
||||
uses = [step["uses"] for step in job["steps"] if "uses" in step]
|
||||
self.assertTrue(any(item.startswith("actions/attest@") for item in uses))
|
||||
self.assertTrue(any(item.startswith("anchore/sbom-action@") for item in uses))
|
||||
sbom = next(step for step in job["steps"] if step.get("uses", "").startswith("anchore/sbom-action@"))
|
||||
self.assertTrue(any(item.startswith(("anchore/sbom-action@", "step-security/sbom-action@")) for item in uses))
|
||||
sbom = next(step for step in job["steps"] if step.get("uses", "").startswith(("anchore/sbom-action@", "step-security/sbom-action@")))
|
||||
self.assertEqual(sbom["with"]["upload-release-assets"], "false")
|
||||
self.assertEqual(sbom["with"]["format"], "cyclonedx-json")
|
||||
|
||||
@@ -64,7 +64,7 @@ class SupplyChainOptInTests(unittest.TestCase):
|
||||
steps = self.supply["jobs"]["attest"]["steps"]
|
||||
collection = next(step for step in steps if step.get("name") == "Collect release files")
|
||||
for index, step in enumerate(steps):
|
||||
if step.get("uses", "").startswith(("anchore/sbom-action@", "actions/attest@")):
|
||||
if step.get("uses", "").startswith(("anchore/sbom-action@", "step-security/sbom-action@", "actions/attest@")):
|
||||
self.assertLess(steps.index(collection), index)
|
||||
self.assertNotIn("if", step)
|
||||
self.assertNotIn("continue-on-error", collection)
|
||||
|
||||
Reference in new issue
Block a user