How tailscale/github-action works
Main Components
• GitHub Workflow Runner Environment:
• Environment that gets triggered on a GitHub Action run.
• That this runner executes the workflow (e.g., .github/workflows/tailscale.yml).
• Tailscale GitHub Action Module:
• Action component (action.yml file) that encapsulates the integration with Tailscale.
• Configuration inputs such as oauth-client-id, oauth-secret, authkey, tags, statedir, and version.
• Tailscale Authentication & Connection:
• Two potential flows:
▪ OAuth Client Flow: Uses OAuth client credentials to connect the ephemeral node.
▪ Tailnet Lock Flow: Uses a pre-signed auth key along with a state directory for storing client state data.
• Tailscale Coordination/Control Plane:
• An external Tailscale network/service component where the ephemeral nodes are registered, marked preapproved, and later cleaned up.
• That this external system handles ACL tags and device approvals.
Relationships and Interactions
• The GitHub Workflow runner kicks off a workflow (via the YAML file in .github/workflows) that references the Tailscale GitHub Action.
• The Tailscale GitHub Action receives input parameters (via action.yml) and then initiates a connection to the Tailscale control server.
• Depending on the inputs, the connection flow diverges into either the OAuth credentials mode or Tailnet Lock mode.
• After authentication, the Tailscale client sets up an ephemeral node that is integrated into the tailnet, with subsequent workflow steps enabled to access internal nodes as needed.
Architectural Patterns and Design Principles
• Modularity: The action is designed as a self-contained module that can be easily plugged into different GitHub workflows.
• Extensibility: Note that version selection (specific version vs. latest) and support for both connection flows (OAuth vs. auth key) allow for adaptable use cases per workflow.
Technologies and Frameworks
• GitHub Actions: Driving the workflows via the .github/workflows and action.yml files.
• Tailscale: The external networking tool that provides secure connectivity between nodes.
• OAuth and Tailnet Lock: Authentication mechanisms are key to the action’s configuration.