Skip to content

ci: allow manual C-header generation on any branch - #392

Open
alessandroferraioli95 wants to merge 1 commit into
masterfrom
ci-dispatch-c-headers
Open

alessandroferraioli95 wants to merge 1 commit into
masterfrom
ci-dispatch-c-headers

Conversation

@alessandroferraioli95

Copy link
Copy Markdown

What

Adds a workflow_dispatch trigger to the Test and deploy workflow so the C-header generation can be run manually against any branch — not only on master pushes — and pushes the result to a matching branch in Auterion/c_library_v2 and Auterion/c_library_v1.

Changes

  • .github/workflows/test_and_deploy.yml
    • New workflow_dispatch trigger with an optional clibrary_branch input.
    • Deploy job gate relaxed to github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch'.
    • Deploy job exports CLIBRARY_GIT_BRANCHNAME: ${{ inputs.clibrary_branch || github.ref_name }}.
  • scripts/update_c_library.sh
    • Reads CLIBRARY_GIT_BRANCHNAME from the environment (defaults to master).
    • For a non-master target: git checkout -B <branch> on top of the freshly-cloned c_library default branch, then force-pushes the regenerated snapshot. Master behavior is unchanged.

update_generated_repos.sh is untouched — it already clones the c_library repos from their default branch, which is the correct base for the snapshot.

How to use (after this is on the default branch)

⚠️ GitHub only reads workflow_dispatch triggers from the copy of the workflow on the repo's default branch. The "Run workflow" button appears only once this change has reached master.

  1. Actions → Test and deployRun workflow.
  2. Select the branch to generate from (e.g. pr-manual_control_status).
  3. Optionally set clibrary_branch to override the target branch name (defaults to the selected branch).
  4. Run. Tests gate the deploy; on success the generated headers are force-pushed to the matching branch in c_library_v2 and c_library_v1.

Notes

  • The target c_library branch is a disposable, autogenerated snapshot rebuilt from scratch on every dispatch (force-pushed) — don't hand-edit it.

🤖 Generated with Claude Code

Add a workflow_dispatch trigger to "Test and deploy" so the C-header
generation can be run manually from the Actions UI (or `gh workflow run`)
against any branch, instead of only on master pushes.

- Relax the deploy job gate to also run on workflow_dispatch.
- Derive the target c_library branch from the dispatched branch name
  (github.ref_name), with an optional `clibrary_branch` input override.
- update_c_library.sh now reads CLIBRARY_GIT_BRANCHNAME from the env
  (default master); for a non-master target it creates/resets the branch
  on top of the freshly-cloned default branch and force-pushes the
  regenerated snapshot, so master pushes keep their existing behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alessandroferraioli95
alessandroferraioli95 changed the base branch from pr-manual_control_status to master July 16, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant