Skip to content

Commit 8434978

Browse files
authored
trigger mend workflow from release (#6298)
1 parent 4769963 commit 8434978

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

.github/workflows/mend.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- "v[0-9]+.[0-9]+.[0-9]+"
97
paths-ignore:
108
- docs/**
119
- examples/**
10+
workflow_dispatch:
11+
inputs:
12+
branch:
13+
type: string
14+
required: false
15+
default: main
16+
workflow_call:
17+
inputs:
18+
branch:
19+
type: string
20+
required: true
1221

1322
concurrency:
1423
group: ${{ github.ref_name }}-mend
@@ -21,10 +30,11 @@ jobs:
2130
scan:
2231
name: Mend
2332
runs-on: ubuntu-22.04
24-
if: ${{ github.event.repository.fork == false }}
2533
steps:
2634
- name: Checkout Repository
2735
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36+
with:
37+
ref: ${{ inputs.branch && inputs.branch || github.ref }}
2838

2939
- name: Download agent
3040
run: curl -fsSLJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar
@@ -34,6 +44,6 @@ jobs:
3444

3545
- name: Scan and upload
3646
env:
37-
PRODUCT_NAME: kubernetes-ingress-controller_${{ github.ref_name }}
47+
PRODUCT_NAME: kubernetes-ingress-controller_${{ inputs.branch && inputs.branch || github.ref_name }}
3848
PROJECT_NAME: nic
3949
run: java -jar wss-unified-agent.jar -noConfig true -wss.url ${{ secrets.WSS_URL }} -apiKey ${{ secrets.WSS_NGINX_TOKEN }} -product $PRODUCT_NAME -project $PROJECT_NAME -d .

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ jobs:
124124
env:
125125
GITHUB_TOKEN: ${{ secrets.NGINX_PAT }}
126126

127+
mend:
128+
if: ${{ ! cancelled() && ! failure() && ! inputs.dry_run && ! contains(inputs.skip_step, 'mend') }}
129+
name: Run Mend workflow
130+
uses: ./.github/workflows/mend.yml
131+
needs: [tag]
132+
with:
133+
branch: "v${{ inputs.nic_version }}"
134+
secrets: inherit
135+
127136
release-oss:
128137
if: ${{ ! cancelled() && ! failure() && ! contains(inputs.skip_step, 'release-oss') }}
129138
name: Release Docker OSS

0 commit comments

Comments
 (0)