From 7eac11de7f30536f8b11cfc1d6aec5e45390ac30 Mon Sep 17 00:00:00 2001 From: Schitiz Sharma Date: Thu, 3 Jul 2025 19:50:14 +0530 Subject: [PATCH 1/2] chore: use inputs context instead of github.event.inputs for reusable workflow compatibility Replace all references to github.event.inputs.environment and github.event.inputs.version with inputs.environment and inputs.version to ensure the workflow functions correctly when called as a reusable workflow via workflow_call trigger. This change ensures the build-and-release.yml workflow can be successfully called from release-approval.yml without build failures due to empty environment variables. References: - https://docs.github.com/en/actions/reference/accessing-contextual-information-about-workflow-runs#example-usage-of-the-inputs-context-in-a-reusable-workflow - https://docs.github.com/en/actions/reference/events-that-trigger-workflows#providing-inputs --- .github/workflows/build-and-release.yml | 10 +++++----- .github/workflows/draft-release-and-changelog.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index a4a4b646c..6fd1749b4 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -31,22 +31,22 @@ on: jobs: build_and_publish_frontend: - name: Build and publish frontend image for ${{ github.event.inputs.environment }} - environment: ${{ github.event.inputs.environment }} + name: Build and publish frontend image for ${{ inputs.environment }} + environment: ${{ inputs.environment }} runs-on: ubuntu-latest env: DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_REPO: ${{ secrets.DOCKER_REPO || 'olakego' }} DOCKER_REPO_WORKER: ${{ secrets.DOCKER_REPO_WORKER || 'olakego' }} - ENVIRONMENT: ${{ github.event.inputs.environment }} - VERSION: ${{ github.event.inputs.version }} + ENVIRONMENT: ${{ inputs.environment }} + VERSION: ${{ inputs.version }} steps: - name: Checkout code uses: actions/checkout@v3 with: - ref: ${{ github.event.inputs.environment == 'master' && 'master' || (github.event.inputs.environment == 'staging' && 'staging' || github.event.inputs.environment == 'dev' && 'ci/workerReleaseIssues' || 'develop') }} + ref: ${{ inputs.environment == 'master' && 'master' || (inputs.environment == 'staging' && 'staging' || inputs.environment == 'dev' && 'ci/workerReleaseIssues' || 'develop') }} - name: Set up Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/draft-release-and-changelog.yml b/.github/workflows/draft-release-and-changelog.yml index c4bf4731f..684c67e86 100644 --- a/.github/workflows/draft-release-and-changelog.yml +++ b/.github/workflows/draft-release-and-changelog.yml @@ -29,7 +29,7 @@ jobs: id: generate-next-version run: | if [ -z "$LATEST_TAG" ]; then - next_version="v0.1.0" + next_version="v0.0.5" else # Remove 'v' prefix and split version into array version=${LATEST_TAG#v} From a03abaae60100c8821f42b61e22ccdba3af50570 Mon Sep 17 00:00:00 2001 From: Schitiz Sharma Date: Thu, 3 Jul 2025 19:54:43 +0530 Subject: [PATCH 2/2] testing testing --- server/cmd/temporal-worker/main.go | 4 ++-- server/conf/app.conf | 2 +- server/routes/router.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/cmd/temporal-worker/main.go b/server/cmd/temporal-worker/main.go index 2a0acdb46..74d2fa62d 100644 --- a/server/cmd/temporal-worker/main.go +++ b/server/cmd/temporal-worker/main.go @@ -21,7 +21,7 @@ func main() { logsdir, _ := config.String("logsdir") logger.InitLogger(logsdir) // init database - postgresDB, _ := config.String("postgresdb") + postgresDB, _ := config.String("costcresdb") err := database.Init(postgresDB) if err != nil { logs.Critical("Failed to initialize database: %s", err) @@ -56,5 +56,5 @@ func main() { // Stop the worker worker.Stop() - logs.Info("Worker stopped. Goodbye!") + logs.Info("Worker stopped. Bye Bye!") } diff --git a/server/conf/app.conf b/server/conf/app.conf index 32be20e07..43e4e3028 100644 --- a/server/conf/app.conf +++ b/server/conf/app.conf @@ -5,4 +5,4 @@ copyrequestbody = true postgresdb = postgres://temporal:temporal@postgresql:5432/postgres?sslmode=disable logsdir = ./logger/logs sessionon = true -TEMPORAL_ADDRESS=temporal:7233 \ No newline at end of file +TEMPORAL_ADDRESS=temporal:7235 \ No newline at end of file diff --git a/server/routes/router.go b/server/routes/router.go index 5895ed259..663c482e8 100644 --- a/server/routes/router.go +++ b/server/routes/router.go @@ -13,7 +13,7 @@ func writeDefaultCorsHeaders(w http.ResponseWriter) { w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, PATCH") w.Header().Set("Access-Control-Allow-Headers", "Origin, Authorization, Content-Type, Accept") w.Header().Set("Access-Control-Allow-Credentials", "true") - w.Header().Set("Access-Control-Max-Age", "86400") + w.Header().Set("Access-Control-Max-Age", "12345") } // CustomCorsFilter handles CORS for different route patterns