Skip to content

Commit

Permalink
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
Browse files Browse the repository at this point in the history
Signed-off-by: Meg McRoberts <[email protected]>
  • Loading branch information
StackScribe committed Mar 17, 2023
2 parents 84bc148 + 70a1854 commit 9937c95
Show file tree
Hide file tree
Showing 99 changed files with 1,960 additions and 1,088 deletions.
23 changes: 23 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
documentation:
- docs/**/*
- "**/*.md"

operator:
- operator/**/*

scheduler:
- scheduler/**/*

metrics-operator:
- metrics-operator/**/*

cert-manager:
- klt-cert-manager/**/*

ops:
- .github/**/*
- netlify.toml
- .markdownlint-cli2.yml

helm:
- helm/**/*
26 changes: 26 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- "pinned"
- "security"
- "future"
- "help wanted"
- "integrations"
- "known issue"
- "known-limitation"
- "Epic"
- "area:security"
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
1 change: 1 addition & 0 deletions .github/workflows/markdown-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ jobs:
echo ""
echo "CRD docs are up to date!"
fi
21 changes: 14 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
packages: write
id-token: write
env:
IMAGE_TAG: ghcr.io/keptn/${{ matrix.config.name }}:${{ needs.release-please.outputs.tag_name }}
IMAGE_NAME: ghcr.io/keptn/${{ matrix.config.name }}
IMAGE_TAG: ${{ needs.release-please.outputs.tag_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -78,16 +79,17 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Cosign
uses: sigstore/cosign-installer@v2.8.1
uses: sigstore/cosign-installer@v3.0.1

- name: Build Docker Image
id: docker_build_image
uses: docker/build-push-action@v4
with:
context: ${{ matrix.config.folder }}
platforms: linux/amd64,linux/arm64
target: production
tags: |
${{ env.IMAGE_TAG }}
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
build-args: |
GIT_HASH=${{ env.GIT_SHA }}
RELEASE_VERSION=dev-${{ env.DATETIME }}
Expand All @@ -99,15 +101,20 @@ jobs:
cache-from: type=gha,scope=${{ github.ref_name }}-${{ matrix.config.name }}
cache-to: type=gha,scope=${{ github.ref_name }}-${{ matrix.config.name }}

- name: Sign container images
- name: Sign container image
env:
COSIGN_EXPERIMENTAL: 1
run: cosign sign ${{ env.IMAGE_TAG }}
IMAGE_DIGEST: ${{ steps.docker_build_image.outputs.digest }}
run: |
cosign sign --yes ${{ env.IMAGE_NAME }}@${{ env.IMAGE_DIGEST }}
cosign verify \
--certificate-identity-regexp="https://github.com/keptn/lifecycle-toolkit/.*" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
${{ env.IMAGE_NAME }}@${{ env.IMAGE_DIGEST }}
- name: Generate SBOM
uses: anchore/[email protected]
with:
image: ${{ env.IMAGE_TAG }}
image: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
artifact-name: sbom-${{ matrix.config.name }}
output-file: ./sbom-${{ matrix.config.name }}.spdx.json

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:
path: images

- name: Trivy image scan
uses: aquasecurity/[email protected].1
uses: aquasecurity/[email protected].2
with:
input: "images/${{ matrix.image }}-image.tar/${{ matrix.image }}-image.tar"
severity: 'CRITICAL,HIGH'
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/set-date.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Set the End Date in the project
name: Set the Date in the project

on:
issues:
types: [closed]
types: [assigned, closed]
jobs:
set_date:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -38,8 +38,9 @@ jobs:
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "End Date") | .id' project_data.json) >> $GITHUB_ENV
echo 'START_DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Start Date") | .id' project_data.json) >> $GITHUB_ENV
echo 'END_DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "End Date") | .id' project_data.json) >> $GITHUB_ENV
- name: Get date
run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV

Expand All @@ -58,9 +59,36 @@ jobs:
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')"
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
- name: Set Start Date
env:
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_PROJECT_TOKEN }}
if: github.event.action == 'assigned'
run: |
gh api graphql -f query='
mutation (
$project: ID!
$item: ID!
$date_field: ID!
$date_value: Date!
) {
set_start_date: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $date_field
value: {
date: $date_value
}
}) {
projectV2Item {
id
}
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f date_field=$START_DATE_FIELD_ID -f date_value=$DATE
- name: Set End Date
env:
GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_PROJECT_TOKEN }}
if: github.event.action == 'closed'
run: |
gh api graphql -f query='
mutation (
Expand All @@ -81,5 +109,5 @@ jobs:
id
}
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f date_field=$DATE_FIELD_ID -f date_value=$DATE
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f date_field=$END_DATE_FIELD_ID -f date_value=$DATE
15 changes: 15 additions & 0 deletions .github/workflows/update-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Set PR Labels

on:
pull_request_target:
jobs:
set-labels:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-22.04
steps:
- name: Update Labels
uses: actions/labeler@v4
with:
sync-labels: true
30 changes: 30 additions & 0 deletions .github/workflows/yaml-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: YAML checks

on:
push:
branches:
- 'main'
- '[0-9]+.[1-9][0-9]*.x'
- 'epic/*'
paths:
- '**.yaml'
- '**.yml'
- '.yamllint'
pull_request:
branches:
- 'main'
- '[0-9]+.[1-9][0-9]*.x'
- 'epic/*'
paths:
- '**.yaml'
- '**.yml'
- '.yamllint'
jobs:
yamllint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Lint YAML files
run: make yamllint

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"0.6.0"}
{".":"0.7.0"}
12 changes: 12 additions & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=keptn_lifecycle-toolkit
sonar.projectName=lifecycle-toolkit
sonar.cpd.exclusions=**/test_*.go,\
scheduler/test/e2e/fake/**/*.go,\
operator/apis/lifecycle/v1alpha1/**/*.go,\
operator/apis/lifecycle/v1alpha2/**/*.go,\
metrics-operator/api/v1alpha1/**/*.go,\
**/zz_generated.deepcopy.go,\
**/fake/**/*.go
sonar.go.exclusions=**/vendor/**,\
**/*_test.go,\
**/fake/**/*.go
37 changes: 37 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
extends: default

rules:
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
max-spaces-inside: 1
colons:
level: warning
commas:
level: warning
comments: disable
comments-indentation: disable
document-end: disable
document-start: disable
empty-lines:
level: warning
hyphens:
level: warning
indentation:
level: warning
spaces: consistent
indent-sequences: consistent
key-duplicates:
level: warning
line-length:
level: warning
max: 150
new-line-at-end-of-file:
level: warning
new-lines:
level: warning
trailing-spaces: disable
truthy: disable

Loading

0 comments on commit 9937c95

Please sign in to comment.