Skip to content

Commit

Permalink
[chore] add labels to pr (open-telemetry#1475)
Browse files Browse the repository at this point in the history
* add label to PR

Signed-off-by: Pierre Tessier <[email protected]>

* Update label-pr.yml

* Update label-pr.yml

* Delete .github/workflows/label-pr.yml

* add labels to PRs

Signed-off-by: Pierre Tessier <[email protected]>

* Update docker-compose.yaml to docker-compose*.yml

---------

Signed-off-by: Pierre Tessier <[email protected]>
Co-authored-by: Juliano Costa <[email protected]>
Co-authored-by: Juliano Costa <[email protected]>
  • Loading branch information
3 people authored Mar 25, 2024
1 parent 5c6b801 commit a1baff7
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
# adds a label to a pull request if certain files are changed
name: Label Pull Requests

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Check for changed files
id: file_changes
uses: dorny/paths-filter@v2
with:
list-files: shell
filters: |
docsUpdateRequired:
- 'src/flagd/**'
helmUpdateRequired:
- '.env'
- 'docker-compose*.yml'
- 'src/flagd/**'
- 'src/grafana/**'
- 'src/otelcollector/**'
- 'src/prometheus/**'
- name: "Add Label: docs-update-required"
if: steps.file_changes.outputs.docsUpdateRequired == 'true'
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue_number = context.issue.number;
github.issues.addLabels({
issue_number: issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['docs-update-required']
})
- name: "Add Label: helm-update-required"
if: steps.file_changes.outputs.helmUpdateRequired == 'true'
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue_number = context.issue.number;
github.issues.addLabels({
issue_number: issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['helm-update-required']
})

0 comments on commit a1baff7

Please sign in to comment.