Skip to content

Commit 96246cd

Browse files
authored
Update workflows (#104)
1 parent 853b962 commit 96246cd

File tree

9 files changed

+119
-116
lines changed

9 files changed

+119
-116
lines changed

.github/labeler.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
enhancement:
2+
- head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/']
3+
4+
bug:
5+
- head-branch: ['^fix/', '^bug/']
6+
7+
chore:
8+
- head-branch: ['^chore/']
9+
10+
tests:
11+
- head-branch: ['^tests/', '^test/']
12+
13+
documentation:
14+
- head-branch: ['^docs/', '^doc/']
15+
- changed-files: '**/*.md'
16+
17+
dependencies:
18+
- head-branch: ['^deps/', '^dep/', '^dependabot/']

.github/release-drafter.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- skip changelog
5+
categories:
6+
- title: 💣 Breaking Changes
7+
labels:
8+
- change
9+
- title: 🚀 Features
10+
labels:
11+
- enhancement
12+
- title: 🐛 Bug Fixes
13+
labels:
14+
- bug
15+
- title: 🧪 Tests
16+
labels:
17+
- tests
18+
- title: 🔨 Maintenance
19+
labels:
20+
- chore
21+
- title: 📝 Documentation
22+
labels:
23+
- documentation
24+
- title: ⬆️ Dependencies
25+
labels:
26+
- dependencies
27+
- title: Other Changes
28+
labels:
29+
- "*"

.github/workflows/ci.yml

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,11 @@ on:
44
push:
55
branches:
66
- main
7-
paths-ignore:
8-
- 'docs/**'
9-
- 'examples/**'
10-
- '**.md'
117
tags:
128
- 'v[0-9]+.[0-9]+.[0-9]+'
139
pull_request:
1410
branches:
1511
- main
16-
types:
17-
- opened
18-
- reopened
19-
- synchronize
20-
paths-ignore:
21-
- 'docs/**'
22-
- 'examples/**'
23-
- '**.md'
2412

2513
env:
2614
platforms: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
@@ -32,46 +20,57 @@ concurrency:
3220
jobs:
3321
build:
3422
name: Build Image
35-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
24+
permissions:
25+
contents: read # for docker/build-push-action to read repo content
26+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
27+
packages: write # for docker/build-push-action to push to GHCR
3628
steps:
3729
- name: Checkout Repository
38-
uses: actions/checkout@v3
39-
with:
40-
fetch-depth: 0
30+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
31+
4132
- name: DockerHub Login
42-
uses: docker/login-action@v2
33+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
4334
with:
4435
username: ${{ secrets.DOCKER_USERNAME }}
4536
password: ${{ secrets.DOCKER_PASSWORD }}
4637
if: github.event_name != 'pull_request'
38+
4739
- name: Login to GitHub Container Registry
48-
uses: docker/login-action@v2
40+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
4941
with:
5042
registry: ghcr.io
5143
username: ${{ github.repository_owner }}
5244
password: ${{ secrets.GITHUB_TOKEN }}
5345
if: github.event_name != 'pull_request'
46+
5447
- name: Login to Quay.io
55-
uses: docker/login-action@v2
48+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
5649
with:
5750
registry: quay.io
5851
username: ${{ secrets.QUAY_USERNAME }}
5952
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
6053
if: github.event_name != 'pull_request'
54+
6155
- name: Setup QEMU
62-
uses: docker/setup-qemu-action@v2
56+
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
6357
with:
6458
platforms: arm64,ppc64le,s390x
6559
if: github.event_name != 'pull_request'
60+
6661
- name: Docker Buildx
67-
uses: docker/setup-buildx-action@v2
62+
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
63+
6864
- name: Output Variables
6965
id: vars
7066
run: |
7167
echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
68+
echo "chart_version=$(yq '.appVersion' <helm-charts/nginx-ingress/Chart.yaml)" >> $GITHUB_OUTPUT
69+
echo "openshift_version=$(yq '.annotations["com.redhat.openshift.versions"]' <bundle/metadata/annotations.yaml | cut -dv -f2)" >> $GITHUB_OUTPUT
70+
7271
- name: Docker meta
7372
id: meta
74-
uses: docker/metadata-action@v4
73+
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0
7574
with:
7675
images: |
7776
nginx/nginx-ingress-operator
@@ -91,8 +90,9 @@ jobs:
9190
release=1
9291
summary="The NGINX Ingress Operator is a Kubernetes/OpenShift component which deploys and manages one or more NGINX/NGINX Plus Ingress Controllers"
9392
description="The NGINX Ingress Operator is a Kubernetes/OpenShift component which deploys and manages one or more NGINX/NGINX Plus Ingress Controllers"
93+
9494
- name: Build Image
95-
uses: docker/build-push-action@v4
95+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
9696
with:
9797
context: '.'
9898
cache-from: type=gha
@@ -104,23 +104,43 @@ jobs:
104104
push: ${{ github.event_name != 'pull_request' }}
105105
no-cache: ${{ github.event_name != 'pull_request' }}
106106
pull: true
107+
sbom: ${{ github.event_name != 'pull_request' }}
108+
provenance: false
109+
107110
- name: Run Trivy vulnerability scanner
108-
uses: aquasecurity/[email protected]
111+
uses: aquasecurity/trivy-action@e5f43133f6e8736992c9f3c1b3296e24b37e17f2 # 0.10.0
109112
continue-on-error: true
110113
with:
111114
image-ref: nginx/nginx-ingress-operator:${{ steps.meta.outputs.version }}
112115
format: 'sarif'
113116
output: 'trivy-results.sarif'
114117
ignore-unfixed: 'true'
118+
115119
- name: Upload Trivy scan results to GitHub Security tab
116-
uses: github/codeql-action/upload-sarif@v2
120+
uses: github/codeql-action/upload-sarif@f3feb00acb00f31a6f60280e6ace9ca31d91c76a # v2.3.2
117121
continue-on-error: true
118122
with:
119123
sarif_file: 'trivy-results.sarif'
124+
120125
- name: Upload Scan Results
121-
uses: actions/upload-artifact@v3
126+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
122127
continue-on-error: true
123128
with:
124129
name: 'trivy-results.sarif'
125130
path: 'trivy-results.sarif'
126131
if: always()
132+
133+
- name: Create/Update Draft
134+
uses: lucacome/draft-release@b79be3ff634f771230b2b6ee9f47308c5793671a # v0.2.0
135+
with:
136+
minor-label: 'enhancement'
137+
major-label: 'change'
138+
variables: |
139+
nic_version=${{ steps.vars.outputs.chart_version }}
140+
openshift_version=${{ steps.vars.outputs.openshift_version }}
141+
notes-footer: |
142+
## Compatibility
143+
144+
- NGINX Ingress Controller {{nic_version}}
145+
- OpenShift {{openshift_version}} or newer.
146+
if: github.event_name != 'pull_request'

.github/workflows/dockerhub-description.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ concurrency:
1313

1414
jobs:
1515
dockerHubDescription:
16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-22.04
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
1919

2020
- name: Modify readme for DockerHub
2121
run: |
2222
sed -i '1,2d' README.md
2323
- name: Docker Hub Description
24-
uses: peter-evans/dockerhub-description@v3
24+
uses: peter-evans/dockerhub-description@579f64ca0abced29dbbc44ab4c6a0b9e33ab3588 # v3.4.1
2525
with:
2626
username: ${{ secrets.DOCKER_USERNAME }}
2727
password: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/labeler.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: joshdales/labeler@a256a58edf82de10195c71e2666c7fcd645b6e97 # if https://github.com/actions/labeler/pull/203 is merged, use the official action actions/labeler
13+
with:
14+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
15+
sync-labels: true

.github/workflows/notifications.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ on:
1111

1212
jobs:
1313
on-failure:
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.repository.fork == false }}
1616
steps:
1717
- name: Data
18-
uses: actions/github-script@v6
18+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
1919
continue-on-error: true
2020
id: data
2121
with:
@@ -36,7 +36,7 @@ jobs:
3636
}
3737
3838
- name: Send Notification
39-
uses: 8398a7/action-slack@v3
39+
uses: 8398a7/action-slack@fbd6aa58ba854a740e11a35d0df80cb5d12101d8 # v3.15.1
4040
with:
4141
status: custom
4242
custom_payload: |

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/stale.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ on:
55

66
jobs:
77
stale:
8-
runs-on: ubuntu-20.04
8+
permissions:
9+
issues: write # for actions/stale to close stale issues
10+
pull-requests: write # for actions/stale to close stale PRs
11+
runs-on: ubuntu-22.04
912
steps:
10-
- uses: actions/stale@v8
13+
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0
1114
with:
1215
repo-token: ${{ secrets.GITHUB_TOKEN }}
1316
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.'

0 commit comments

Comments
 (0)