Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

matanbaruch
Copy link

@matanbaruch matanbaruch commented Jul 24, 2025

This pull request refactors the Tailscale GitHub Action to transition from a composite action to a Node.js-based implementation. The changes simplify the workflow, improve maintainability, and introduce new features for better customization and cleanup. Key changes include the removal of the composite action logic, the addition of a TypeScript-based implementation, and the introduction of post-action cleanup.

Transition to Node.js-based Action:

  • action.yml: Migrated from a composite action to a Node.js-based action using node20. The main entry point is now dist/index.js, with dist/post/index.js handling post-action cleanup.
  • package.json: Added a Node.js project setup with scripts for building, formatting, linting, and testing. Dependencies for GitHub Actions and development tooling (e.g., TypeScript, Jest, ESLint) were introduced.

TypeScript Implementation:

  • src/interface.ts: Defined TypeScript interfaces and enums for input validation, OS detection, caching, and Tailscale-specific configurations. This improves type safety and code clarity.

Post-Action Cleanup:

  • src/post.ts: Implemented a post-action cleanup process to disconnect from Tailscale, log out, and stop the Tailscale daemon (except on Windows). This ensures proper resource cleanup after the action completes.

Fix #174

- Added core files for the Tailscale GitHub Action, including main logic for connecting to Tailscale, handling OS-specific installations, and managing authentication.
- Introduced TypeScript interfaces for better type safety and code organization.
- Implemented a post-action cleanup process to manage Tailscale connections and logs.
- Created configuration files including package.json, tsconfig.json, and .gitignore to support development and build processes.
- Established a package-lock.json to ensure consistent dependency management.

This commit sets the foundation for the Tailscale GitHub Action, enabling users to connect their workflows to Tailscale seamlessly.
- Removed the 'dist/' entry from .gitignore to allow tracking of distribution files.
- Added new distribution files: 'dist/index.js' and 'dist/post/index.js' containing the compiled output for the Tailscale GitHub Action.

This commit prepares the project for distribution by ensuring the necessary files are included in version control.
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.

Feature Request - Cleanup task
1 participant