Skip to content

Commit ab9851c

Browse files
committed
ci: update of common workflows
1 parent 6661862 commit ab9851c

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
3+
# The workflow template for automatic PR labeler.
4+
# It requires to have a configuration file with labels and conditions to apply them.
5+
# The configuration file should be placed in the .github folder and named auto-labeler-config.yaml.
6+
# Example file can be found there:
7+
# https://github.com/Netcracker/.github/blob/main/config/examples/auto-labeler-config.yaml
8+
9+
name: Automatic PR Labeler
10+
11+
on:
12+
pull_request:
13+
branches: [main]
14+
types:
15+
[opened, reopened, synchronize]
16+
17+
permissions:
18+
pull-requests: write
19+
contents: read
20+
issues: write
21+
22+
jobs:
23+
assign-labels:
24+
if: github.event.pull_request.merged == false
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: "Execute assign labels"
30+
id: action-assign-labels
31+
uses: mauroalderete/action-assign-labels@v1
32+
with:
33+
pull-request-number: ${{ github.event.pull_request.number }}
34+
github-token: ${{ github.token }}
35+
conventional-commits: "./.github/auto-labeler-config.yaml"
36+
maintain-labels-not-matched: true
37+
apply-changes: ${{ github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
38+
- name: "Drop warning if PR from fork"
39+
if: ${{ github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id }}
40+
run: |
41+
echo "⚠️ Pull request from fork! ⚠️" >> $GITHUB_STEP_SUMMARY
42+
echo "Labels will not be applied to PR. Assign them manually please." >> $GITHUB_STEP_SUMMARY
43+
echo "Labels to assign: ${{ steps.action-assign-labels.outputs.labels-next }}" >> $GITHUB_STEP_SUMMARY
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
3+
name: "Add commit messages to PR body"
4+
5+
on:
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
update-pr-body:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: "Update PR body"
17+
if: ${{ github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
18+
uses: netcracker/qubership-workflow-hub/actions/pr-add-messages@main
19+
- name: "Warning"
20+
if: ${{ github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
21+
run: |
22+
echo "⚠️ Pull request from fork! ⚠️" >> $GITHUB_STEP_SUMMARY
23+
echo "Can not change PR body." >> $GITHUB_STEP_SUMMARY
24+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Profanity filter
3+
4+
on:
5+
issue_comment:
6+
types: [created, edited]
7+
issues:
8+
types: [opened, edited, reopened]
9+
pull_request:
10+
types: [opened, edited, reopened]
11+
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
16+
jobs:
17+
call-apply-filter:
18+
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) }}
19+
uses: Netcracker/qubership-workflow-hub/.github/workflows/profanityFilter.yaml@main
20+
warning:
21+
runs-on: ubuntu-latest
22+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id }}
23+
steps:
24+
- name: "Warning"
25+
run: |
26+
echo "⚠️ Pull request from fork! ⚠️" >> $GITHUB_STEP_SUMMARY
27+
echo "The action cannot be run over PRs from fork." >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)