diff --git a/.github/config/labeler.yml b/.github/config/labeler.yml new file mode 100644 index 0000000000..22d2b5527f --- /dev/null +++ b/.github/config/labeler.yml @@ -0,0 +1,10 @@ +feature: +- head-branch: 'feature/*' +fix: +- head-branch: 'fix/*' +chore: +- head-branch: 'chore/*' +dependencies: +- any: + - head-branch: 'dependencies/*' + - head-branch: 'dependabot/*' \ No newline at end of file diff --git a/.github/config/pr-labeler.yml b/.github/config/pr-labeler.yml deleted file mode 100644 index eee02c614e..0000000000 --- a/.github/config/pr-labeler.yml +++ /dev/null @@ -1,4 +0,0 @@ -feature: ['feature/*', 'feat/*'] -fix: fix/* -chore :hammer:: chore/* -dependencies: ['dependencies/*', 'dependabot/*'] diff --git a/.github/workflows/pr-labeler-kind.yaml b/.github/workflows/pr-labeler-kind.yaml index 54b9c9af1e..f6af322006 100644 --- a/.github/workflows/pr-labeler-kind.yaml +++ b/.github/workflows/pr-labeler-kind.yaml @@ -1,26 +1,19 @@ name: PR Labeler on: - pull_request: - types: [opened] - -permissions: - contents: read +- pull_request_target jobs: pr-labeler: permissions: - contents: read # for TimonVS/pr-labeler-action to read config file - pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR + contents: read + pull-requests: write runs-on: ubuntu-latest steps: - - name: Generate token - id: generate_token - uses: tibdex/github-app-token@v2 + - uses: actions/checkout@v4 with: - app_id: ${{ secrets.OCMBOT_APP_ID }} - private_key: ${{ secrets.OCMBOT_PRIV_KEY }} + sparse-checkout: | + .github/config/labeler.yml - name: Label PR based on branch name - uses: TimonVS/pr-labeler-action@v5 + uses: actions/labeler@v5 with: - repo-token: ${{ steps.generate_token.outputs.token }} - configuration-path: .github/config/pr-labeler.yml + configuration-path: .github/config/labeler.yml \ No newline at end of file