Skip to content

Commit 4be4d88

Browse files
ci: fix bug the branch name refs/heads/main is being used instead of the tag (#33)
Signed-off-by: Harikrishnan Balagopal <[email protected]>
1 parent 229b861 commit 4be4d88

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

.github/workflows/release.yml

+8-14
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ jobs:
5858
name: Create release draft
5959
runs-on: ubuntu-latest
6060
steps:
61-
- id: only_tag
62-
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
6361
- uses: actions/checkout@v2
6462
with:
6563
ref: ${{ github.event.inputs.commit_ref }}
@@ -90,7 +88,7 @@ jobs:
9088
env:
9189
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
9290
SLACK_ICON: https://github.com/actions.png?size=48
93-
SLACK_MESSAGE: "Release draft for move2kube-operator ${{ steps.only_tag.outputs.tag }} created: https://github.com/konveyor/move2kube-operator/releases"
91+
SLACK_MESSAGE: "Release draft for move2kube-operator ${{ github.event.inputs.tag }} created: https://github.com/konveyor/move2kube-operator/releases"
9492
SLACK_TITLE: Success
9593
SLACK_USERNAME: GitHubActions
9694

@@ -99,26 +97,22 @@ jobs:
9997
name: Image build
10098
runs-on: ubuntu-latest
10199
steps:
102-
- id: only_tag
103-
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
104100
- uses: actions/checkout@v2
105101
with:
106102
ref: ${{ github.event.inputs.commit_ref }}
107103
- name: build
108104
run: |
109-
VERSION=${{ steps.only_tag.outputs.tag }} make docker-build
110-
VERSION=${{ steps.only_tag.outputs.tag }} make bundle-build
111-
- name: Push images to quay
112-
run: |
113-
echo "${{ secrets.QUAY_BOT_PASSWORD }}" | docker login --username "${{ secrets.QUAY_BOT_USERNAME }}" --password-stdin quay.io
114-
VERSION=${{ steps.only_tag.outputs.tag }} make docker-push
115-
docker push quay.io/konveyor/move2kube-bundle:${{ steps.only_tag.outputs.tag }}
105+
VERSION=${{ github.event.inputs.tag }} make docker-build
106+
VERSION=${{ github.event.inputs.tag }} make bundle-build
107+
- run: echo "${{ secrets.QUAY_BOT_PASSWORD }}" | docker login --username "${{ secrets.QUAY_BOT_USERNAME }}" --password-stdin quay.io
108+
- name: push the image to quay
109+
run: VERSION='${{ github.event.inputs.tag }}' make docker-push
116110
- name: success slack notification
117111
uses: rtCamp/action-slack-notify@v2
118112
env:
119113
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
120114
SLACK_ICON: https://github.com/actions.png?size=48
121-
SLACK_MESSAGE: "Built and pushed quay.io/konveyor/move2kube-operator:${{ steps.only_tag.outputs.tag }}"
115+
SLACK_MESSAGE: "Built and pushed quay.io/konveyor/move2kube-operator:${{ github.event.inputs.tag }}"
122116
SLACK_TITLE: Success
123117
SLACK_USERNAME: GitHubActions
124118
- if: failure()
@@ -128,7 +122,7 @@ jobs:
128122
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
129123
SLACK_COLOR: "#BD3232"
130124
SLACK_ICON: https://github.com/actions.png?size=48
131-
SLACK_MESSAGE: "Failed to build and push image quay.io/konveyor/move2kube-operator:${{ steps.only_tag.outputs.tag }}"
125+
SLACK_MESSAGE: "Failed to build and push image quay.io/konveyor/move2kube-operator:${{ github.event.inputs.tag }}"
132126
SLACK_TITLE: Failed
133127
SLACK_USERNAME: GitHubActions
134128

0 commit comments

Comments
 (0)