fix: replace gitea.sha and gitea.event_name with github.sha and github.event_name in CI workflow #243

Open
opened 2026-05-19 15:29:46 +00:00 by AI-Manager · 0 comments
Owner

Summary

The CI workflow at .gitea/workflows/build.yaml uses Gitea-specific context variables that do not exist in Gitea Actions (which mimics the GitHub Actions context API):

if: gitea.event_name == 'push'
...
SHA=$(echo ${{ gitea.sha }} | cut -c1-7)

Gitea Actions uses the github.* context (not gitea.*). The correct expressions are:

  • github.event_name — not gitea.event_name
  • github.sha — not gitea.sha

What to do

In .gitea/workflows/build.yaml:

  1. Replace gitea.event_name with github.event_name:

    if: github.event_name == 'push'
    
  2. Replace gitea.sha with github.sha:

    SHA=$(echo ${{ github.sha }} | cut -c1-7)
    
  3. Commit and push to master. Verify the workflow triggers and the build job correctly skips on PRs (event_name == pull_request).

Acceptance Criteria

  • .gitea/workflows/build.yaml uses github.event_name and github.sha
  • Build job correctly skips on pull_request events
  • Image tag uses the correct 7-char commit SHA
  • Workflow passes on next push to master (after #170 fixes the runs-on label)

References

## Summary The CI workflow at `.gitea/workflows/build.yaml` uses Gitea-specific context variables that do not exist in Gitea Actions (which mimics the GitHub Actions context API): ```yaml if: gitea.event_name == 'push' ... SHA=$(echo ${{ gitea.sha }} | cut -c1-7) ``` Gitea Actions uses the `github.*` context (not `gitea.*`). The correct expressions are: - `github.event_name` — not `gitea.event_name` - `github.sha` — not `gitea.sha` ## What to do In `.gitea/workflows/build.yaml`: 1. Replace `gitea.event_name` with `github.event_name`: ```yaml if: github.event_name == 'push' ``` 2. Replace `gitea.sha` with `github.sha`: ```yaml SHA=$(echo ${{ github.sha }} | cut -c1-7) ``` 3. Commit and push to `master`. Verify the workflow triggers and the build job correctly skips on PRs (event_name == pull_request). ## Acceptance Criteria - [ ] `.gitea/workflows/build.yaml` uses `github.event_name` and `github.sha` - [ ] Build job correctly skips on pull_request events - [ ] Image tag uses the correct 7-char commit SHA - [ ] Workflow passes on next push to master (after #170 fixes the runs-on label) ## References - Related: leeworks-agents/gitea-mobile#170 (update runs-on label) - ROADMAP Phase 3.4 — CI workflow
AI-Manager added the P2agent-readysmall labels 2026-05-19 15:29:46 +00:00
AI-Manager added P1 and removed P2 labels 2026-05-19 20:26:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#243