67 lines
3.1 KiB
YAML
67 lines
3.1 KiB
YAML
name: C3 PR policy verification
|
|
'on':
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
route:
|
|
runs-on: ${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login
|
|
== 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
|
|
'renovate/')) && 'renovate' || 'docker' }}
|
|
if: ${{ contains(fromJSON('["andras","ruby336688","renovate-bot"]'), github.actor)
|
|
&& (!github.event.pull_request || contains(fromJSON('["andras","ruby336688","renovate-bot"]'),
|
|
github.event.pull_request.user.login)) }}
|
|
env:
|
|
CI_UNTRUSTED: ${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login
|
|
== 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
|
|
'renovate/')) }}
|
|
REGISTRY_TOKEN: ${{ !(github.actor == 'renovate-bot' || github.event.pull_request.user.login
|
|
== 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
|
|
'renovate/')) && secrets.FORGEJO_PACKAGE_TOKEN || '' }}
|
|
steps:
|
|
- name: Verify identity routing and credential boundary
|
|
run: "set -eu\ntest ! -S /var/run/docker.sock\ntest ! -e /pages\nawk '$1 ==\
|
|
\ 0 { if ($2 == 0) exit 1; found=1 } END { if (!found) exit 1 }' /proc/self/uid_map\n\
|
|
if [ \"$CI_UNTRUSTED\" = true ]; then\n test -z \"$REGISTRY_TOKEN\"\n echo\
|
|
\ BOT_SECRET_FREE_ROOTLESS_OK\nelse\n test \"$CI_UNTRUSTED\" = false\n echo\
|
|
\ HUMAN_FULL_CONTAINER_OK\nfi\nmkdir context\nprintf 'FROM docker.io/library/alpine:3.22\\\
|
|
nRUN echo verified >/proof\\n' >context/Dockerfile\n"
|
|
- name: Build without publishing or registry credentials
|
|
uses: https://git.schmelczer.dev/andras/ci-actions/docker-publish@c80f2f0701d7618f1f0b2bb52ebd332ea34b6e28
|
|
with:
|
|
context: context
|
|
push: 'false'
|
|
full-environment:
|
|
runs-on: ${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login
|
|
== 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
|
|
'renovate/')) && 'renovate-ubuntu' || 'ubuntu-latest' }}
|
|
if: ${{ contains(fromJSON('["andras","ruby336688","renovate-bot"]'), github.actor)
|
|
&& (!github.event.pull_request || contains(fromJSON('["andras","ruby336688","renovate-bot"]'),
|
|
github.event.pull_request.user.login)) }}
|
|
steps:
|
|
- run: 'set -eu
|
|
|
|
. /etc/os-release
|
|
|
|
test "$ID" = ubuntu
|
|
|
|
sudo -n true
|
|
|
|
node --version
|
|
|
|
git --version
|
|
|
|
test ! -S /var/run/docker.sock
|
|
|
|
echo FULL_CI_IMAGE_OK
|
|
|
|
'
|
|
trusted-release-gate:
|
|
runs-on: docker
|
|
if: ${{ contains(fromJSON('["andras","ruby336688","renovate-bot"]'), github.actor)
|
|
&& (!github.event.pull_request || contains(fromJSON('["andras","ruby336688","renovate-bot"]'),
|
|
github.event.pull_request.user.login)) && !(github.actor == 'renovate-bot' ||
|
|
github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref,
|
|
'refs/heads/renovate/') || startsWith(github.head_ref, 'renovate/')) }}
|
|
steps:
|
|
- run: echo TRUSTED_HUMAN_GATE_OK
|