From 2228d8e43835fa229e5c228097bacc8879b5e5db Mon Sep 17 00:00:00 2001 From: Nicolas Lamirault Date: Fri, 8 Dec 2023 11:57:08 +0100 Subject: [PATCH] Fix: Github settings Signed-off-by: Nicolas Lamirault --- .github/labeler.yml | 28 +++++++------- .github/workflows/project-pr-labeler.yml | 48 ++++++++++++++++++++++++ .pre-commit-config.yaml | 6 +-- 3 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/project-pr-labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml index 2fbbee2..eef2963 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -16,22 +16,20 @@ # Labels for action/labeler -area/kubernetes: - - kubernetes/* - - kubernetes/**/* +###################################### +# Label area/xxx -cloud/gcp: - - iac/gcp/* - - iac/gcp/**/* +area/inspec: +- changed-files: + - any-glob-to-any-file: controls/** -cloud/aws: - - iac/aws/* - - iac/aws/**/* +area/github: +- changed-files: + - any-glob-to-any-file: .github/** -cloud/azure: - - iac/azure/* - - iac/azure/**/* +###################################### +# Label cloud/xxx -kind/documentation: - - docs/* - - docs/**/* +cloud/azure: +- changed-files: + - any-glob-to-any-file: controls/** diff --git a/.github/workflows/project-pr-labeler.yml b/.github/workflows/project-pr-labeler.yml new file mode 100644 index 0000000..1535c06 --- /dev/null +++ b/.github/workflows/project-pr-labeler.yml @@ -0,0 +1,48 @@ +# Copyright (C) Nicolas Lamirault +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +# name: "Label PRs from globs" +# on: +# schedule: +# - cron: "0 * * * *" + +# jobs: +# execute: +# runs-on: ubuntu-latest +# steps: +# - uses: jpmcb/prow-github-actions@v1.1.1 +# with: +# jobs: 'pr-labeler' +# github-token: "${{ secrets.GITHUB_TOKEN }}" + +--- +name: Project / Pull Request Labeler + +on: # yamllint disable-line rule:truthy + pull_request: + types: [opened, reopened, edited] + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - name: Monitor Actions + uses: GitHubSecurityLab/actions-permissions/monitor@v1 + with: + config: ${{ vars.PERMISSIONS_CONFIG }} + - uses: actions/labeler@v5.0.0 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f91faba..af9015a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -28,11 +28,11 @@ repos: exclude: mkdocs.yml - id: check-added-large-files - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.1.10 + rev: v1.3.1 hooks: - id: insert-license files: (Makefile|\.mk|Gemfile|\.yaml|\.yml|\.rb) args: - --license-filepath - LICENSE - # - --remove-header \ No newline at end of file + # - --remove-header