Skip to content

Commit 33a870f

Browse files
author
Paulo Gomes da Cruz Junior
authored
feat: adding tagging (#136)
1 parent abd22b9 commit 33a870f

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

.github/workflows/merge-main.yml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
output: "trivy-results.sarif"
8383
ignore-unfixed: true
8484
severity: "CRITICAL,HIGH"
85-
security-checks: "vuln,secret,config"
85+
scanners: "vuln,secret,config"
8686

8787
- name: Upload Trivy scan results to GitHub Security tab
8888
uses: github/codeql-action/upload-sarif@v2
@@ -164,26 +164,88 @@ jobs:
164164
reporters: '["cli"]'
165165
folder: '["general"]'
166166

167+
- name: Conventional Changelog Update
168+
uses: TriPSs/conventional-changelog-action@v3
169+
id: changelog
170+
continue-on-error: true
171+
with:
172+
github-token: ${{ github.token }}
173+
output-file: 'CHANGELOG.md'
174+
skip-version-file: 'true'
175+
skip-commit: 'true'
176+
git-push: 'true'
177+
178+
- name: Create Release
179+
uses: softprops/action-gh-release@v1
180+
if: ${{ steps.changelog.outputs.tag != '' }}
181+
env:
182+
GITHUB_TOKEN: ${{ github.token }}
183+
with:
184+
token: ${{ github.token }}
185+
tag_name: ${{ steps.changelog.outputs.tag }}
186+
name: ${{ steps.changelog.outputs.tag }}
187+
body: ${{ steps.changelog.outputs.clean_changelog }}
188+
189+
- name: Exporting version
190+
run: echo "version=${{ steps.changelog.outputs.tag }}" >> $GITHUB_OUTPUT
191+
167192
image-promotions:
168193
name: Promote images to PROD
169194
needs:
170195
- deploy-test
171196
runs-on: ubuntu-22.04
197+
permissions:
198+
contents: write
199+
discussions: write
172200
strategy:
173201
matrix:
174202
component: [ api, init ]
175203
steps:
204+
- name: Checkout
205+
uses: actions/checkout@v3
206+
207+
- name: Conventional Changelog Update
208+
uses: TriPSs/conventional-changelog-action@v3
209+
id: changelog
210+
continue-on-error: true
211+
with:
212+
github-token: ${{ github.token }}
213+
output-file: 'CHANGELOG.md'
214+
skip-version-file: 'true'
215+
skip-commit: 'true'
216+
git-push: 'true'
217+
218+
- name: Create Release
219+
uses: softprops/action-gh-release@v1
220+
if: ${{ steps.changelog.outputs.tag != '' }}
221+
env:
222+
GITHUB_TOKEN: ${{ github.token }}
223+
with:
224+
token: ${{ github.token }}
225+
tag_name: ${{ steps.changelog.outputs.tag }}
226+
name: ${{ steps.changelog.outputs.tag }}
227+
body: ${{ steps.changelog.outputs.clean_changelog }}
228+
176229
- uses: shrink/actions-docker-registry-tag@v3
177230
with:
178231
registry: ghcr.io
179232
repository: ${{ github.repository }}/${{ matrix.component }}
180233
target: test
181234
tags: prod
182235

236+
- uses: shrink/actions-docker-registry-tag@v3
237+
if: ${{ steps.deploy-test.outputs.version != '' }}
238+
with:
239+
registry: ghcr.io
240+
repository: ${{ github.repository }}/${{ matrix.component }}
241+
target: test
242+
tags: ${{ steps.deploy-test.outputs.version }}
243+
183244
deploy-prod:
184245
name: PROD Deployment
185246
needs:
186247
- deploy-test
248+
- image-promotions
187249
runs-on: ubuntu-22.04
188250
environment:
189251
name: prod

.github/workflows/pr-open.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
# Current changelog
6868
6969
${{ steps.changelog.outputs.clean_changelog }}
70-
comment_tag: '# Current changelog'
70+
comment_includes: Current changelog
7171
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7272

7373
pr-greeting:

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
output: "trivy-results.sarif"
8989
ignore-unfixed: true
9090
severity: "CRITICAL,HIGH"
91-
security-checks: "vuln,secret,config"
91+
scanners: "vuln,secret,config"
9292

9393
- name: Upload Trivy scan results to GitHub Security tab
9494
uses: github/codeql-action/upload-sarif@v2

0 commit comments

Comments
 (0)