Skip to content

Commit 69b3ba7

Browse files
committed
ci(pipeline.yml): #275 use cog-bump:v0.2.0 with dryrun custom action in docker-build-push job
1 parent 247878c commit 69b3ba7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/pipeline.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,16 @@ jobs:
142142
run: git fetch --tags origin
143143
shell: bash
144144
- id: bump-version
145-
uses: armakuni/github-actions/bump-version@main
145+
uses: abhisheksr01/github-actions/[email protected]
146+
with:
147+
dry-run: true
146148
- name: check-bump-version-output
147149
run: |
148-
echo "version-was-bump: ${{ steps.bump-version.outputs.version-was-bump }}"
149150
echo "previous-version: ${{ steps.bump-version.outputs.previous-version }}"
151+
echo "bump-version: ${{ steps.bump-version.outputs.bump-version }}"
150152
echo "current-version: ${{ steps.bump-version.outputs.current-version }}"
153+
echo "is-version-bumped: ${{ steps.bump-version.outputs.is-version-bumped }}"
154+
echo "is-dryrun-version-bumped: ${{ steps.bump-version.outputs.is-dryrun-version-bumped }}"
151155
shell: bash
152156
- name: Login to Docker Hub
153157
uses: docker/login-action@v3
@@ -164,20 +168,20 @@ jobs:
164168
context: git
165169
tags: |
166170
type=ref,event=pr
167-
type=semver,pattern={{version}},prefix=v,value=${{ steps.bump-version.outputs.current-version }}
171+
type=semver,pattern={{version}},prefix=v,value=${{ steps.bump-version.outputs.bump-version }}
168172
labels: |
169173
"org.opencontainers.image.title": "abhisheksr01/companieshouse",
170174
"org.opencontainers.image.description": "Best practices and integrations available for Spring Boot based Microservice in a single repository with companieshouse API use case.",
171175
"org.opencontainers.image.url": "https://github.com/abhisheksr01/spring-boot-microservice-best-practices",
172176
"org.opencontainers.image.source": "https://github.com/abhisheksr01/spring-boot-microservice-best-practices",
173-
"org.opencontainers.image.version": ${{ steps.bump-version.outputs.current-version }},
177+
"org.opencontainers.image.version": ${{ steps.bump-version.outputs.bump-version }},
174178
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
175179
"org.opencontainers.image.revision": ${{ github.sha }},
176180
"org.opencontainers.image.licenses": "MIT"
177181
- name: Build and push
178182
uses: docker/build-push-action@v6
179183
with:
180-
push: ${{ github.event_name != 'pull_request' && steps.bump-version.outputs.version-was-bump == 'true' }} # Only push on main branch & when version is bumped
184+
push: ${{ github.event_name != 'pull_request' && steps.bump-version.outputs.is-dryrun-version-bumped == 'true' }} # Only push on main branch & when version is bumped with dryrun. We will create tags and creates separately after proper testing
181185
tags: ${{ steps.meta.outputs.tags }}
182186
labels: ${{ steps.meta.outputs.labels }}
183187
sbom: true

0 commit comments

Comments
 (0)