From d3507feaa50c569313af2740ffc915be184310c7 Mon Sep 17 00:00:00 2001 From: Ibrahim Alhas Date: Wed, 16 Oct 2024 16:48:09 +0100 Subject: [PATCH] fixed CI/CD action for labeling pushes to main --- .github/.github/labeler.yml | 16 +++++++++++++ .github/workflows/labeler.yml | 43 +++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 .github/.github/labeler.yml diff --git a/.github/.github/labeler.yml b/.github/.github/labeler.yml new file mode 100644 index 000000000..77c9cad93 --- /dev/null +++ b/.github/.github/labeler.yml @@ -0,0 +1,16 @@ +core: + - 'animal-ai/**' + +# Label for changes in documentation files +documentation: + - '**/*.md' + - 'docs/**' + +# Label for changes related to CI/CD workflows +ci: + - '.github/workflows/**' + +# Label for YAML configuration changes +configuration: + - '**/*.yaml' + - '**/*.yml' \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 3f5e0255f..f4ca6a39b 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,17 +1,30 @@ -# Label for changes in the core application code -core: - - 'animal-ai/*' +name: "Label PRs based on changes" -# Label for changes in documentation files -documentation: - - '**/*.md' - - 'docs/**' +on: + push: + branches: + - main + paths: + - 'animal-ai/**' + - '**/*.md' + - 'docs/**' + - '.github/workflows/**' + - '**/*.yaml' + - '**/*.yml' + pull_request: + paths: + - 'animal-ai/**' + - '**/*.md' + - 'docs/**' + - '.github/workflows/**' + - '**/*.yaml' + - '**/*.yml' -# Label for changes related to CI/CD workflows -ci: - - '.github/workflows/**' - -# Label for YAML configuration changes -configuration: - - '**/*.yaml' - - '**/*.yml' \ No newline at end of file +jobs: + labeler: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/labeler@v2 + with: + configuration-path: .github/labeler.yml \ No newline at end of file