Skip to content

Commit 0d52bd4

Browse files
authored
chore: merge pull request #23 from Netcracker/broadcast-workflows
chore: update of common workflows
2 parents 8a844ce + ba5b37c commit 0d52bd4

File tree

8 files changed

+66
-57
lines changed

8 files changed

+66
-57
lines changed

.github/workflows/automatic-pr-labeler.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,52 @@
77
# https://github.com/Netcracker/.github/blob/main/config/examples/auto-labeler-config.yaml
88

99
name: Automatic PR Labeler
10-
10+
run-name: PR #${{ github.event.pull_request.number }} - Automatic Labeler
1111
on:
1212
pull_request:
1313
branches: [main]
1414
types:
1515
[opened, reopened, synchronize]
1616

1717
permissions:
18-
pull-requests: write
1918
contents: read
20-
issues: write
2119

2220
jobs:
2321
assign-labels:
22+
name: "Assign Labels to PR #${{ github.event.pull_request.number }}"
2423
if: (github.event.pull_request.merged == false) && (github.event.pull_request.user.login != 'dependabot[bot]') && (github.event.pull_request.user.login != 'github-actions[bot]')
24+
permissions:
25+
pull-requests: write
26+
contents: read
27+
issues: write
2528
runs-on: ubuntu-latest
2629
steps:
27-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30+
- name: "Checkout Repository"
31+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2832
with:
2933
persist-credentials: false
3034

3135
- name: "Execute assign labels"
3236
id: action-assign-labels
33-
uses: mauroalderete/action-assign-labels@v1
37+
uses: mauroalderete/action-assign-labels@671a4ca2da0f900464c58b8b5540a1e07133e915 # v1.5.1
3438
with:
3539
pull-request-number: ${{ github.event.pull_request.number }}
3640
github-token: ${{ github.token }}
3741
conventional-commits: "./.github/auto-labeler-config.yaml"
3842
maintain-labels-not-matched: true
3943
apply-changes: ${{ github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id }}
44+
45+
- name: "Set labels-next safely for PR from fork"
46+
if: ${{ github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id }}
47+
run: |
48+
echo "LABELS_NEXT=$(echo ${STEPS_ACTION_ASSIGN_LABELS_OUTPUTS_LABELS_NEXT} | tr -dc 'a-zA-Z0-9-,')" >> $GITHUB_ENV
49+
env:
50+
STEPS_ACTION_ASSIGN_LABELS_OUTPUTS_LABELS_NEXT: ${{ steps.action-assign-labels.outputs.labels-next }}
4051
- name: "Drop warning if PR from fork"
4152
if: ${{ github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id }}
4253
run: |
4354
{
4455
echo "⚠️ Pull request from fork! ⚠️";
4556
echo "Labels will not be applied to PR. Assign them manually please.";
46-
echo "Labels to assign: ${{ steps.action-assign-labels.outputs.labels-next }}";
57+
echo "Labels to assign: '${LABELS_NEXT}'";
4758
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/cla.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
issue_comment:
55
types: [created]
66
pull_request_target:
7-
types: [opened, closed, synchronize]
7+
types: [opened]
88

99
permissions:
1010
contents: read

.github/workflows/link-checker.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
---
2-
name: Link Checker
2+
name: "Link Checker"
33

44
on:
55
push: null
66
repository_dispatch: null
77
workflow_dispatch: null
88
pull_request:
99
branches: [main]
10-
types:
11-
[opened, reopened, synchronize]
1210
permissions:
1311
contents: read
1412
jobs:
1513
linkChecker:
14+
name: "Run Link Checker"
1615
runs-on: ubuntu-latest
1716
steps:
18-
- uses: actions/checkout@v4
17+
- name: "Checkout code"
18+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19+
with:
20+
persist-credentials: false
1921

20-
- name: Restore lychee cache
21-
uses: actions/cache@v4
22+
- name: "Restore lychee cache"
23+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
2224
id: restore-cache
2325
with:
2426
path: .lycheecache
2527
key: cache-lychee-${{ github.sha }}
2628
restore-keys: cache-lychee-
2729

28-
- name: Link Checker
30+
- name: "Link Checker"
2931
id: lychee
30-
uses: lycheeverse/lychee-action@v2
32+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 #v2.7.0
3133
with:
3234
args: >-
3335
'./**/*.md'

.github/workflows/pr-assigner.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,29 @@ on:
77
- main
88

99
permissions:
10-
pull-requests: write
1110
contents: read
1211

1312
jobs:
1413
pr-auto-assign:
14+
name: "Auto-assign Reviewers to PR #${{ github.event.pull_request.number }}"
1515
runs-on: ubuntu-latest
16-
16+
permissions:
17+
pull-requests: write
18+
contents: read
1719
steps:
18-
- name: Check if PR is from a fork
20+
- name: "Check if PR is from a fork"
1921
run: |
2022
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.event.pull_request.base.repo.full_name }}" ]; then
2123
echo "⚠️ Pull request is from a fork — skipping assignee assignment (no write permissions)."
2224
exit 0
2325
fi
2426
25-
- uses: actions/checkout@v5
27+
- name: "Checkout Repository"
28+
uses: actions/checkout@v6.0.1
2629
with:
2730
persist-credentials: false
2831

29-
- uses: netcracker/qubership-workflow-hub/actions/pr-assigner@b575bad3a0959c4e883bc34f9d055ff07fde2dbd #2.0.1
32+
- name: "Assign Reviewers"
33+
uses: netcracker/qubership-workflow-hub/actions/pr-assigner@8d542a426ce561c7dce745f6b9cee068d1d7e101 #2.0.10
3034
env:
3135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr-conventional-commits.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ permissions:
1313
pull-requests: read
1414
jobs:
1515
build:
16-
name: Conventional Commits
16+
name: "Conventional Commits Check"
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
19+
- name: "Checkout Repository"
20+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
2021
with:
2122
persist-credentials: false
2223

23-
- uses: webiny/action-conventional-commits@v1.3.0
24+
- name: "Conventional Commits Check"
25+
uses: webiny/action-conventional-commits@faccb24fc2550dd15c0390d944379d2d8ed9690e #v1.3.1

.github/workflows/pr-lint-title.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
name: Validate PR title
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: amannn/action-semantic-pull-request@v6
21+
- name: "Semantic PR Title Lint"
22+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
2223
env:
2324
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/profanity-filter.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ permissions:
1515

1616
jobs:
1717
apply-filter:
18+
name: "Apply Profanity Filter"
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Scan issue or pull request for profanity
2122
# Conditionally run the step if the actor isn't a bot
2223
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]' }}
23-
uses: IEvangelist/profanity-filter@9.07
24+
uses: IEvangelist/profanity-filter@10.0
2425
id: profanity-filter
2526
with:
2627
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/super-linter.yaml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,49 +29,38 @@ permissions:
2929
contents: read
3030

3131
jobs:
32-
prepare-configs:
32+
super-linter:
33+
name: "Lint Code Base"
3334
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
packages: read
38+
statuses: write
3439
steps:
3540
- name: "Get the common linters configuration"
36-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3742
with:
3843
ref: main # fix/superlinter-config
3944
repository: netcracker/.github
4045
persist-credentials: false
46+
path: common-configs
4147
sparse-checkout: |
4248
config/linters
43-
- name: "Upload the common linters configuration"
44-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
45-
with:
46-
name: linter-config
47-
path: "${{ github.workspace }}/config"
48-
include-hidden-files: true
49-
run-lint:
50-
needs: [prepare-configs]
51-
runs-on: ubuntu-latest
52-
permissions:
53-
contents: read
54-
packages: read
49+
- name: "Move configs"
50+
run: |
51+
cp --update=none -vRT ./common-configs/config/linters /tmp/linters
52+
rm -rf ./common-configs
5553
# To report GitHub Actions status checks
56-
statuses: write
57-
steps:
58-
- name: Checkout code
59-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
54+
- name: "Checkout code"
55+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
6056
with:
6157
# Full git history is needed to get a proper list of changed files within `super-linter`
6258
fetch-depth: 0
6359
persist-credentials: false
64-
- name: "Get the common linters configuration"
65-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
66-
id: download
67-
with:
68-
name: linter-config
69-
path: /tmp/linter-config
7060
- name: "Apply the common linters configuration"
71-
if: ${{ steps.download.outputs.download-path != '' }}
7261
run: |
7362
mkdir -p ./.github/linters
74-
cp --update=none -vRT /tmp/linter-config/linters ./.github/linters
63+
cp --update=none -vRT /tmp/linters ./.github/linters
7564
7665
- name: "Load super-linter environment file"
7766
shell: bash
@@ -81,18 +70,17 @@ jobs:
8170
echo "Applying local linter environment:"
8271
grep "\S" ${GITHUB_WORKSPACE}/.github/super-linter.env | grep -v "^#"
8372
grep "\S" ${GITHUB_WORKSPACE}/.github/super-linter.env | grep -v "^#" >> $GITHUB_ENV
84-
elif [ -f "/tmp/linter-config/linters/super-linter.env" ]; then
73+
elif [ -f "/tmp/linters/super-linter.env" ]; then
8574
echo "::warning:: Local linter environment file .github/super-linter.env is not found"
8675
echo "Applying common linter environment:"
87-
grep "\S" /tmp/linter-config/linters/super-linter.env | grep -v "^#"
88-
grep "\S" /tmp/linter-config/linters/super-linter.env | grep -v "^#" >> $GITHUB_ENV
76+
grep "\S" /tmp/linters/super-linter.env | grep -v "^#"
77+
grep "\S" /tmp/linters/super-linter.env | grep -v "^#" >> $GITHUB_ENV
8978
fi
9079
91-
- name: Lint Code Base
92-
uses: super-linter/super-linter/slim@ffde3b2b33b745cb612d787f669ef9442b1339a6 # v8.1.0
80+
- name: "Lint Code Base"
81+
uses: super-linter/super-linter/slim@61abc07d755095a68f4987d1c2c3d1d64408f1f9 # v8.5.0
9382
env:
9483
VALIDATE_ALL_CODEBASE: ${{ inputs.full_scan || false }}
9584
# To report GitHub Actions status checks
9685
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9786
DEFAULT_BRANCH: ${{ github.event.pull_request.base.ref || github.event.push.ref }}
98-

0 commit comments

Comments
 (0)