Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/automatic-pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

# The workflow template for automatic PR labeler.
# It requires to have a configuration file with labels and conditions to apply them.
# The configuration file should be placed in the .github folder and named auto-labeler-config.yaml.
# Example file can be found there:
# https://github.com/Netcracker/.github/blob/main/config/examples/auto-labeler-config.yaml

name: Automatic PR Labeler

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

permissions:
pull-requests: write
contents: read
issues: write

jobs:
assign-labels:
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: "Execute assign labels"
id: action-assign-labels
uses: mauroalderete/action-assign-labels@v1
with:
pull-request-number: ${{ github.event.pull_request.number }}
github-token: ${{ github.token }}
conventional-commits: "./.github/auto-labeler-config.yaml"
maintain-labels-not-matched: true
apply-changes: ${{ github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
- name: "Drop warning if PR from fork"
if: ${{ github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id }}
run: |
echo "⚠️ Pull request from fork! ⚠️" >> $GITHUB_STEP_SUMMARY
echo "Labels will not be applied to PR. Assign them manually please." >> $GITHUB_STEP_SUMMARY
echo "Labels to assign: ${{ steps.action-assign-labels.outputs.labels-next }}" >> $GITHUB_STEP_SUMMARY
24 changes: 24 additions & 0 deletions .github/workflows/pr-collect-commit-messages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---

name: "Add commit messages to PR body"

on:
pull_request:
types: [opened, synchronize]

permissions:
pull-requests: write

jobs:
update-pr-body:
runs-on: ubuntu-latest
steps:
- name: "Update PR body"
if: ${{ github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
uses: netcracker/qubership-workflow-hub/actions/pr-add-messages@main
- name: "Warning"
if: ${{ github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
run: |
echo "⚠️ Pull request from fork! ⚠️" >> $GITHUB_STEP_SUMMARY
echo "Can not change PR body." >> $GITHUB_STEP_SUMMARY

27 changes: 27 additions & 0 deletions .github/workflows/profanity-filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Profanity filter

on:
issue_comment:
types: [created, edited]
issues:
types: [opened, edited, reopened]
pull_request:
types: [opened, edited, reopened]

permissions:
issues: write
pull-requests: write

jobs:
call-apply-filter:
if: ${{ github.event_name == 'issue_comment' || github.event_name == 'issues' || (github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id) }}
uses: Netcracker/qubership-workflow-hub/.github/workflows/profanityFilter.yaml@main
warning:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id }}
steps:
- name: "Warning"
run: |
echo "⚠️ Pull request from fork! ⚠️" >> $GITHUB_STEP_SUMMARY
echo "The action cannot be run over PRs from fork." >> $GITHUB_STEP_SUMMARY