From 3d9a09496de04b5a80b25dad7f631b522a4f1c41 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Thu, 7 May 2026 18:46:18 -0500 Subject: [PATCH] fix(actions): use per-step status in workflow job API response; add build workflow ToActionWorkflowJob was calling ToActionsStatus(job.Status) for every step, making each step reflect the whole job conclusion instead of its own state. Replace the inline loop with the existing ToActionWorkflowStep helper which correctly uses step.Status. Add .gitea/workflows/build-push.yaml to build and push a Docker image to Artifact Registry on push to this branch, enabling deployment to GKE. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/build-push.yaml | 59 ++++++++++++++++++++++++++++++++ services/convert/convert.go | 10 +----- 2 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 .gitea/workflows/build-push.yaml diff --git a/.gitea/workflows/build-push.yaml b/.gitea/workflows/build-push.yaml new file mode 100644 index 0000000000..bfb4eacd4f --- /dev/null +++ b/.gitea/workflows/build-push.yaml @@ -0,0 +1,59 @@ +name: Build & Push Gitea image + +on: + push: + branches: + - feat/workflow-step-events + workflow_dispatch: + +jobs: + build-push: + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Authenticate to GCP + uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ secrets.GCP_SA_KEY }} + + - name: Set up gcloud + uses: google-github-actions/setup-gcloud@v2 + with: + project_id: neuron-785695 + + - name: Configure Docker for Artifact Registry + run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet + + - name: Set image tag + id: tag + run: | + SHA="${GITHUB_SHA:0:8}" + echo "tag=us-central1-docker.pkg.dev/neuron-785695/neuron-ci/gitea:${SHA}" >> "$GITHUB_OUTPUT" + echo "latest=us-central1-docker.pkg.dev/neuron-785695/neuron-ci/gitea:latest" >> "$GITHUB_OUTPUT" + echo "SHA=${SHA}" >> "$GITHUB_OUTPUT" + + - name: Build Gitea image + run: | + docker build \ + --build-arg GITEA_VERSION="neuron-$(git rev-parse --short HEAD)" \ + --build-arg TAGS="sqlite sqlite_unlock_notify" \ + -t "${{ steps.tag.outputs.tag }}" \ + -t "${{ steps.tag.outputs.latest }}" \ + . + + - name: Push Gitea image + run: | + docker push "${{ steps.tag.outputs.tag }}" + docker push "${{ steps.tag.outputs.latest }}" + echo "Pushed gitea:${{ steps.tag.outputs.SHA }} and :latest" + + - name: Output image tag + run: | + echo "::notice title=Image pushed::${{ steps.tag.outputs.tag }}" + echo "Update deployment.yaml image to: ${{ steps.tag.outputs.tag }}" diff --git a/services/convert/convert.go b/services/convert/convert.go index 0854fb4478..05fee95a74 100644 --- a/services/convert/convert.go +++ b/services/convert/convert.go @@ -405,15 +405,7 @@ func ToActionWorkflowJob(ctx context.Context, repo *repo_model.Repository, task runnerName = runner.Name } for i, step := range task.Steps { - stepStatus, stepConclusion := ToActionsStatus(job.Status) - steps = append(steps, &api.ActionWorkflowStep{ - Name: step.Name, - Number: int64(i), - Status: stepStatus, - Conclusion: stepConclusion, - StartedAt: step.Started.AsTime().UTC(), - CompletedAt: step.Stopped.AsTime().UTC(), - }) + steps = append(steps, ToActionWorkflowStep(step, i)) } } }