Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deployment version selection for releasing workflow #4971

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/deploy-staging-and-prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
set -x
environment=$(echo $VERSION | sed -n 's#\([0-9]\+\).\([0-9]\+\).*#saleor-staging-v\1\2#p')
echo "ENVIRONMENT=${environment}" >> "$GITHUB_ENV"

- name: Set custom version
env:
VERSION: ${{ github.event.inputs.git_ref || github.ref_name }}
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
CHECK_ID: ${{ steps.create-check.outputs.CHECK_ID }}
CHECK_NAME: "Deploy_staging"
STATUS: "completed"
CONCLUSION: "${{ steps.deploy.outcome }}"
CONCLUSION: "${{ steps.deploy.outcome }}"
TITLE: "Deploy staging"
SUMMARY: "Deploy finished with status ${{ steps.deploy.outcome }}. To check details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
DETAILS_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Expand All @@ -156,15 +156,18 @@ jobs:
export GITHUB_TOKEN=$( \
curl --request GET --url ${{ secrets.VAULT_URL}} --header "Authorization: JWT ${{ secrets.VAULT_JWT }}" | jq -r .token \
)
gh api /repos/saleor/saleor-cloud-deployments/dispatches \
--input - <<< '{
"event_type": "open-release-pull-request",
"client_payload": {
"project": "DASHBOARD",
"environment": "SANDBOX",
"version": "${{ env.VERSION }}"
}
}'

version=$(cat package.json | jq -r .version)
payload=$(jq --null-input --arg version "$version" '{
"event_type": "open-release-pull-request",
"client_payload": {
"project": "DASHBOARD",
"environment": "SANDBOX",
"version": $version
}
}')

gh api /repos/saleor/saleor-cloud-deployments/dispatches --input - <<< $payload

run-tests-on-release:
needs: [prepare-release, build]
Expand Down
Loading