Skip to content

Commit 3584508

Browse files
authored
Merge pull request #17 from kubescape/fixci
fix CI
2 parents 19f44f1 + d8739fa commit 3584508

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ assignees: ''
2020
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
2121

2222
## Additional context
23-
<!-- Add any other context or screenshots about the feature request here. -->
23+
<!-- Add any other context or screenshots about the feature request here. -->
24+

.github/PULL_REQUEST_TEMPLATE.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
## Overview
2-
This PR fixes #
3-
4-
<!-- **[Signed Commits](../CONTRIBUTING.md#sign-off-per-commit)** -->
5-
**Signed Commits**
6-
- [ ] Yes, I signed my commits.
7-
82
<!-- Please provide a brief overview of the changes made in this pull request. e.g. current behavior/future behavior -->
93

104
<!--
@@ -49,4 +43,5 @@ put an [x] in the box to get it checked
4943
5044
**Please open the PR against the `dev` branch (Unless the PR contains only documentation changes)**
5145
52-
-->
46+
-->
47+

.github/workflows/pr-created.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: pull_request_created
2+
permissions: read-all
23
on:
34
pull_request:
45
types: [opened, reopened, synchronize, ready_for_review]
5-
branches:
6-
- 'main'
76
paths-ignore:
87
- '*.md'
98
- '*.yaml'
@@ -20,6 +19,6 @@ jobs:
2019
security-events: write
2120
uses: kubescape/workflows/.github/workflows/incluster-comp-pr-created.yaml@main
2221
with:
23-
GO_VERSION: "1.22"
2422
CGO_ENABLED: 0
23+
GO_VERSION: "1.22"
2524
secrets: inherit

.github/workflows/pr-merged.yaml

+25-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
11
name: pr-merged
2+
permissions: read-all
23
on:
34
pull_request_target:
45
types: [closed]
56
branches:
67
- 'main'
78
paths-ignore:
8-
- '**.md' ### Ignore running when README.MD changed.
9-
- '**.yaml' ### Ignore running when YAML files changed.
10-
- '.github/workflows/*' ### Ignore running when files under path: .github/workflows/* changed.
9+
- '*.md'
10+
- '*.yaml'
11+
- '.github/workflows/*'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
1116

1217
jobs:
18+
reset-run-number:
19+
runs-on: ubuntu-latest
20+
name: reset github.run_number
21+
outputs:
22+
run-number: ${{ steps.get-build.outputs.build-number }}
23+
steps:
24+
- name: Get build number
25+
id: get-build
26+
uses: mlilback/build-number@v1
27+
with:
28+
base: -149
29+
run-id: ${{ github.run_number }}
30+
1331
pr-merged:
14-
if: ${{ github.event.pull_request.merged == true }}
32+
if: ${{ github.event.pull_request.merged == true }} ## Skip if not merged
33+
needs: reset-run-number
1534
permissions:
1635
id-token: write
1736
packages: write
18-
contents: read
37+
contents: write
1938
pull-requests: read
2039
uses: kubescape/workflows/.github/workflows/incluster-comp-pr-merged.yaml@main
2140
with:
2241
IMAGE_NAME: quay.io/${{ github.repository_owner }}/prometheus-exporter
23-
IMAGE_TAG: v0.0.${{ github.run_number }}
42+
IMAGE_TAG: v0.0.${{ needs.reset-run-number.outputs.run-number }}
2443
COMPONENT_NAME: prometheus-exporter
2544
CGO_ENABLED: 0
2645
GO111MODULE: "on"

0 commit comments

Comments
 (0)