blob: 26ef1cba8978a3cd27e80fe121294b9e30a65366 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
name: Label
on:
issues:
types: [opened, edited, reopened]
pull_request_target:
types: [opened, edited, reopened, synchronize]
push:
branches: [main]
paths:
- scripts/label.py
- website/data/services.json
- bindings/**
- integrations/**
- .github/workflows/label.yml
permissions:
contents: read
concurrency:
group: label-${{ github.event.pull_request.number || github.event.issue.number || 'catalog' }}
cancel-in-progress: false
jobs:
catalog:
if: github.event_name == 'push'
runs-on: ubuntu-slim
timeout-minutes: 5
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Create missing repository labels
env:
GH_TOKEN: ${{ github.token }}
run: python3 scripts/label.py sync
classify:
if: github.event_name != 'push'
runs-on: ubuntu-slim
timeout-minutes: 5
permissions:
contents: read
issues: write
pull-requests: write
steps:
# Never execute code from the PR being classified, including same-repo PRs.
- uses: actions/checkout@v7
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
- name: Classify the current issue or PR
env:
GH_TOKEN: ${{ github.token }}
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: python3 scripts/label.py event --apply