-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ci schedule and cleanup dependabot (#26)
- Loading branch information
Showing
5 changed files
with
133 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
scaffolder-skeletons/ci_schedule/.github/workflows/schedule.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Scheduled tasks | ||
|
||
on: | ||
schedule: | ||
- cron: '${{ values.schedule }}' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
{%- if values.trivy %} | ||
schedule-trivy: | ||
uses: radiorabe/actions/.github/workflows/schedule-trivy.yaml@${{ values.actions_version }} | ||
with: | ||
image-ref: ${{ values.trivy_image_ref }} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
version: 2 | ||
updates: | ||
{%- if values.is_docker %} | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
- package-ecosystem: docker | ||
directory: / | ||
schedule: | ||
interval: "daily" | ||
interval: daily | ||
commit-message: | ||
prefix: "chore: " | ||
groups: | ||
baseimages: | ||
patterns: | ||
- "*" | ||
{%- endif %} | ||
{%- if values.is_python %} | ||
- package-ecosystem: pip | ||
directory: "/" | ||
{%- if values.is_github_actions %} | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: "daily" | ||
interval: daily | ||
commit-message: | ||
prefix: "chore(ci): " | ||
{%- endif %} | ||
{%- if values.is_github_actions %} | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
{%- if values.is_python %} | ||
- package-ecosystem: pip | ||
directory: / | ||
schedule: | ||
interval: "daily" | ||
interval: daily | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
apiVersion: scaffolder.backstage.io/v1beta3 | ||
kind: Template | ||
metadata: | ||
name: ci_schedule | ||
title: CI Schedule | ||
description: Enable scheduled CI runs on an existing project. | ||
tags: | ||
- security | ||
spec: | ||
owner: it-reaktion | ||
type: ci | ||
parameters: | ||
- title: Choose a location | ||
required: | ||
- repoUrl | ||
properties: | ||
repoUrl: | ||
title: Repository Location | ||
type: string | ||
ui:field: RepoUrlPicker | ||
ui:options: | ||
allowedHosts: | ||
- github.com | ||
allowedOwners: | ||
- radiorabe | ||
requestUserCredentials: | ||
secretsKey: USER_GITHUB_OAUTH_TOKEN | ||
- title: Configure Schedule | ||
required: | ||
- schedule | ||
properties: | ||
schedule: | ||
title: Schedule in crontab syntax | ||
type: string | ||
default: "13 12 * * *" | ||
- title: Enable Features | ||
required: | ||
- trivy | ||
properties: | ||
trivy: | ||
title: Enable Trivy | ||
type: boolean | ||
default: true | ||
readOnly: true | ||
- title: Configure Trivy | ||
required: | ||
- trivy_image_ref | ||
properties: | ||
trivy_image_ref: | ||
title: Image Ref | ||
type: string | ||
default: ghcr.io/radiorabe/<changeme>:latest | ||
steps: | ||
- id: getversion | ||
name: Get radiorabe/actions version | ||
action: http:backstage:request | ||
input: | ||
method: 'GET' | ||
path: /proxy/api.github.com/repos/radiorabe/actions/releases/latest | ||
- id: fetch-base | ||
name: Fetch Base | ||
action: fetch:template | ||
input: | ||
url: ../../scaffolder-skeletons/ci_schedule/ | ||
replace: true | ||
values: | ||
actions_version: ${{ steps.getversion.output.body.tag_name }} | ||
schedule: ${{ parameters.schedule }} | ||
trivy: ${{ parameters.trivy }} | ||
trivy_image_ref: ${{ parameters.trivy_image_ref }} | ||
- id: publish | ||
name: Publish | ||
action: publish:github:pull-request | ||
input: | ||
title: "chore(ci): configure scheduled CI runs" | ||
token: ${{ secrets.USER_GITHUB_OAUTH_TOKEN }} | ||
repoUrl: ${{ parameters.repoUrl }} | ||
branchName: chore/ci/schedule | ||
description: | | ||
# Scheduled GitHub Actions | ||
Configure scheduled CI runs. | ||
## Schedule | ||
``` | ||
${{ parameters.schedule }} | ||
``` | ||
## Jobs | ||
{%- if parameters.trivy %} | ||
* [Trivy](https://trivy.dev) (via [radiorabe/actions](https://radiorabe.github.io/actions/#container-schedule)) | ||
{%- endif %} | ||
output: | ||
links: | ||
- url: ${{steps.publish.output.remoteUrl}} | ||
title: "Go to PR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters