Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cla-assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_call:
inputs:
repository:
description: "The repository that the CLA is generated for"
description: "The repository that the CLA is generated for. Example `hello-world`."
required: true
type: string
version:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:

# branch should not be protected
branch: "main"
allowlist: ""
allowlist: "semantic-release-bot"
lock-pullrequest-aftermerge: false
use-dco-flag: false

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/cla-internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -----------
# NOTICE: This workflow is for internal use within the CI repository
# -----------

name: "CLA Assistant"

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
CLAAssistant:
permissions:
actions: write
contents: read
pull-requests: write
statuses: write
name: "CLA Assistant"
uses: ctfpilot/ci/.github/workflows/cla-assistant.yml@v1.0.0
secrets: inherit
with:
repository: ci
107 changes: 107 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Docker build and push
on:
workflow_call:
inputs:
repository:
description: "Allowed repository for workflow to run in. Example `ctfpilot/hello-world`."
required: true
type: string
dockerfile:
description: "Dockerfile path."
required: false
default: "./Dockerfile"
type: string
context:
description: "Build context."
required: false
default: "."
type: string
arguments:
description: "Build arguments. List of key-value pairs."
required: false
default: ""
type: string
semver:
description: "Semantic version. Leave empty to not use semantic versioning."
required: false
default: ""
type: string
tags:
description: "List of tags to apply to the image. Required if you do not use semantic versioning."
required: false
default: |
type=raw,value=${{ github.sha }}
Comment on lines +32 to +33
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for tags input contains a template expression ${{ github.sha }} which will not be evaluated properly in the workflow input default. Default values for workflow inputs cannot use GitHub Actions expressions. This should either be removed or the expression should be evaluated in the job itself.

Copilot uses AI. Check for mistakes.
type: string
registry:
description: "Registry for docker image to use. Defaults to GitHub container registry."
required: false
default: ghcr.io
type: string
image_name:
description: "Docker image name to use. Defaults to repository name."
required: false
default: ${{ github.repository }}
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for image_name input contains a template expression ${{ github.repository }} which will not be evaluated properly in the workflow input default. Default values for workflow inputs cannot use GitHub Actions expressions. This should either be removed or the expression should be evaluated in the job itself.

Copilot uses AI. Check for mistakes.
type: string
registry_username:
description: "Username to use for registry login. Defaults to GitHub actor."
required: false
type: string
registry_token:
description: "Token to use for registry login. Defaults to GITHUB_TOKEN."
required: false
type: string
fetch_submodules:
description: "Fetch submodules. Defaults to true."
required: false
default: true
type: boolean
platforms:
description: "Platforms to build for (comma separated, e.g., linux/amd64,linux/arm64)."
required: false
default: linux/amd64
type: string
runner:
description: "Runner to use for the job. Defaults to ubuntu-latest."
required: false
default: ubuntu-latest
type: string
cacheFrom:
description: "Cache type from"
required: false
type: string
default: type=gha
cacheTo:
description: "Cache type to"
required: false
type: string
default: type=gha,mode=max
commit:
description: "Commit SHA to use for git operations and tagging. Defaults to github.sha."
required: false
default: ${{ github.sha }}
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for commit input contains a template expression ${{ github.sha }} which will not be evaluated properly in the workflow input default. Default values for workflow inputs cannot use GitHub Actions expressions. This should either be removed or the expression should be evaluated in the job itself.

Copilot uses AI. Check for mistakes.
type: string

jobs:
docker:
uses: the0mikkel/ci/.github/workflows/docker.yml@v1.4.1
if: github.repository == inputs.repository
permissions:
contents: read
packages: write
id-token: write
with:
dockerfile: ${{ inputs.dockerfile }}
context: ${{ inputs.context }}
arguments: ${{ inputs.arguments }}
semver: ${{ inputs.semver }}
tags: ${{ inputs.tags }}
registry: ${{ inputs.registry }}
image_name: ${{ inputs.image_name }}
registry_username: ${{ inputs.registry_username }}
registry_token: ${{ inputs.registry_token }}
fetch_submodules: ${{ inputs.fetch_submodules }}
platforms: ${{ inputs.platforms }}
runner: ${{ inputs.runner }}
cacheFrom: ${{ inputs.cacheFrom }}
cacheTo: ${{ inputs.cacheTo }}
commit: ${{ inputs.commit }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_call:
inputs:
repository:
description: "The repository to release"
description: "Allowed repository for workflow to run in. Example `ctfpilot/hello-world`."
required: true
type: string
ENVIRONMENT:
Expand Down Expand Up @@ -37,4 +37,4 @@ jobs:
uses: the0mikkel/ci/.github/workflows/semver-release-standalone.yml@v1.4.1
secrets: inherit
with:
ENVIRONMENT: ENVIRONMENT
ENVIRONMENT: ${{ inputs.ENVIRONMENT }}
70 changes: 61 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
> [!IMPORTANT]
> This CI repository is meant for internal usage within the CTFPilot organization.

This repository contains Continuous intergration automation, in the forms of Github Action workflows.
This repository contains Continuous intergration automation, in the forms of GitHub Action workflows.

## How to use

Expand All @@ -20,7 +20,7 @@ jobs:
permissions:
<permissions>
name: <name>
uses: ctfpilot/ci/.github/workflows/<workflow>@<version>
uses: ctfpilot/ci/.github/workflows/<workflow>.yml@<version>
with:
<inputs>
```
Expand All @@ -29,16 +29,19 @@ jobs:

- [`cla-assistant`](#cla-assistant): CLA Assistant bot
- [`release`](#release): Release system
- [`docker`](#docker): Docker build and push system

### CLA Assistant

This workflow contains the CLA Assistant bot used througout CTF Pilot.
This workflow contains the CLA Assistant bot used throughout CTF Pilot.

It is setup to contain sensible defaults, but requires the `repository` input to be specified.

The workflow can only be run within the `ctfpilot` organization.

#### Inputs

- `repository`: The repository that the CLA is generated for
- `repository`: The repository that the CLA is generated for. Example `hello-world`.
- `version`: CLA version. Keep default to use organization default.
- `CLASHA`: The SHA for the commit, the CLA version is. Keep default to use organization default.

Expand All @@ -65,20 +68,21 @@ jobs:
pull-requests: write
statuses: write
name: "CLA Assistant"
uses: ctfpilot/ci/.github/workflows/cla-assistant@<version>
uses: ctfpilot/ci/.github/workflows/cla-assistant.yml@<version>
secrets: inherit
with:
repository: <repository>
```

### Release

This workflow contains the release system used througout CTF Pilot.
This workflow contains the release system used throughout CTF Pilot.

The wofklow requires the `repository` input to be specified.
The workflow requires the `repository` input to be specified.

#### Inputs

- `repository`: The repository that the CLA is generated for
- `repository`: Allowed repository for workflow to run in. Example `ctfpilot/hello-world`.
- `ENVIRONMENT`: The environment to deploy to.

#### Secrets
Expand Down Expand Up @@ -108,7 +112,55 @@ jobs:
packages: write
id-token: write
name: "Release"
uses: ctfpilot/ci/.github/workflows/release@<version>
uses: ctfpilot/ci/.github/workflows/release.yml@<version>
with:
repository: <repository>
```

### Docker

This workflow contains the Docker build and push system used throughout CTF Pilot.

The workflow requires the `repository` input to be specified.

#### Inputs

- `repository`: Allowed repository for workflow to run in. Example `ctfpilot/hello-world`.
- `dockerfile`: Dockerfile path.
- `context`: Build context.
- `arguments`: Build arguments. List of key-value pairs.
- `semver`: Semantic version. Leave empty to not use semantic versioning.
- `tags`: List of tags to apply to the image. Required if you do not use semantic versioning.
- `registry`: Registry for docker image to use. Defaults to GitHub container registry.
- `image_name`: Docker image name to use. Defaults to repository name.
- `registry_username`: Username to use for registry login. Defaults to GitHub actor.
- `registry_token`: Token to use for registry login. Defaults to GITHUB_TOKEN.
- `fetch_submodules`: Fetch submodules. Defaults to true.
- `platforms`: Platforms to build for (comma separated, e.g., linux/amd64,linux/arm64).
- `runner`: Runner to use for the job. Defaults to ubuntu-latest
- `cacheFrom`: Cache type from
- `cacheTo`: Cache type to
- `commit`: Commit SHA to use for git operations and tagging. Defaults to github.sha.

#### How to use

```yml
name: "Docker build and push"

on:
push:
branches:
- main
- develop

jobs:
CLAAssistant:
permissions:
contents: read
packages: write
id-token: write
name: "Docker build and push"
uses: ctfpilot/ci/.github/workflows/docker.yml@<version>
with:
repository: <repository>
```
Expand Down
Loading