⚠️ Under active development: These GitHub Actions are currently under active development. Functionality, inputs, and usage patterns may change. If you have any suggestions please raise an issue or notify the seal team at support@seal.run. It is recommended to pin to specific commit SHAs or version tags once available, rather than using@mainor:latestin production workflows.
This repository contains reusable GitHub Actions designed to integrate GitHub workflows with the Seal platform. These actions automate common tasks related to change control and artifact management within Seal.
This action captures a snapshot of the repository's codebase at the time a pull request is active and links it to a corresponding entity in Seal.
Functionality:
- Trigger: Designed to run in the context of a pull request.
- Archive Creation: Creates an archive (either
.zipor.tar.gz) of the entire checked-out codebase. It allows specifying file patterns (exclude_patterns) to exclude certain files or directories (like.gitornode_modules) from the archive. - Seal Entity Lookup: Searches for a specific Seal entity (typically representing a change request) using the pull request number (
#<PR_NUMBER>) and a providedseal_template_idto ensure the correct type of entity is found. It requires a unique match. - Archive Upload: Uploads the generated archive file to Seal, assigning it a filename based on the repository, PR number, and timestamp, along with a specified file type title (
seal_file_type_title). - Linking: Fetches the ID and version of the uploaded archive file entity in Seal and then links this file reference to a specified field (
seal_snapshot_field_name, defaulting to 'Code Snapshot') on the previously found Seal entity.
Purpose: To provide a verifiable record of the exact codebase state associated with a specific change request tracked in Seal.
Inputs:
seal_api_token(required): Seal API Token. Use${{ secrets.SEAL_API_TOKEN }}.seal_api_base_url(required): Seal API Base URL (e.g.,https://us.backend.seal.run/api/).seal_template_id(required): Seal Template ID for the target change control entity.seal_system(optional): Seal system slug for the target change control entity. Leave unset to search all systems visible to the API token.large_file_upload_mode(optional, default:direct): Set tosignedto upload archives larger than 30 MiB through signed storage uploads. This requiresseal_systemand a deployment supporting/api/v3/files/prepare-uploadand/api/v3/files/complete-upload. In signed mode,seal_systemselects the system for both the target entity lookup and all snapshot uploads, including smaller direct uploads. The default retains legacy upload behavior.signed_upload_template_id(optional): File template ID for deployments whose signed-upload API usestemplateId. Leave unset on older deployments that usetypeTitle; those keep usingseal_file_type_title. This setting only affects signed uploads above 30 MiB.seal_snapshot_field_name(optional, default:Code Snapshot): Name of the reference field in the Seal entity to link the snapshot.seal_file_type_title(optional, default:GitHub Artifacts): Title for the uploaded file type in Seal.exclude_patterns(optional): Space-separated glob patterns to exclude from the archive (e.g.,.git/* node_modules/*).archive_type(optional, default:zip): The type of archive to create (supported:zip,tar;tarproduces a.tar.gzfile).
Large snapshots: After checking that your deployment supports both signed-upload endpoints, opt in with:
with:
# Keep your existing API token, base URL, template and other inputs.
large_file_upload_mode: 'signed'
seal_system: 'YOUR_SYSTEM_SLUG'Choose the system containing your target change control and file type. Archives up to and including 30 MiB still use the direct endpoint with CRC32C validation. Larger archives stream to the signed storage URL with a Content-MD5 checksum, then complete the upload in Seal before joining the changeset and linking the new file entity. A failed signed upload fails the action without falling back to the size-limited endpoint. This option applies only to Codebase Snapshot; Upload Artifacts keeps its existing behavior.
Check your deployment's API docs for the upload target: older releases accept typeTitle; newer releases accept templateId. For the newer API, also set signed_upload_template_id to a File template. This is separate from seal_template_id, which identifies the target change control template. Do not set it on a release that only supports typeTitle.
Pin the action to a reviewed commit or version when adopting this option. Removing large_file_upload_mode restores the legacy upload flow; archives above its limit will fail again. No deployment upgrade is needed when the two signed-upload endpoints are already supported.
This action finds specific files (artifacts) within the repository based on patterns and links them to a corresponding entity in Seal.
Functionality:
- Trigger: Designed to run in the context of a pull request or other events (e.g., release).
- Artifact Discovery: Finds files within the workspace that match one or more space-separated glob patterns provided via the
artifact_patternsinput. - Seal Entity Lookup: Searches for a specific Seal entity using the pull request number (
#<PR_NUMBER>) and a providedseal_template_id. It requires a unique match. (Lookup method might be configurable in future versions). - Individual File Upload: Uploads each found artifact file individually to Seal. Each uploaded file is given a unique name including the original filename, PR number (if applicable), and an index, along with a specified file type title (
seal_file_type_title). - Linking: Collects the ID and version of each successfully uploaded artifact file entity. It then links all these file references as a list to a specified field (
seal_field_name) on the previously found Seal entity.
Purpose: To attach specific outputs, documentation, or evidence related to a change request (e.g., build outputs, test reports, updated READMEs) directly to the corresponding record in Seal.
Inputs:
seal_api_token(required): Seal API Token. Use${{ secrets.SEAL_API_TOKEN }}.seal_api_base_url(required): Seal API Base URL (e.g.,https://us.backend.seal.run/api/).seal_template_id(required): Seal Template ID for the target change control entity.seal_system(optional): Seal system slug for the target change control entity. Leave unset to search all systems visible to the API token.artifact_patterns(required): Space-separated glob patterns matching the artifacts to upload (e.g.,"dist/**/*.js" "docs/*.pdf"). Use quotes if patterns contain spaces or special characters.seal_field_name(optional, default:Release Artifact(s)): Name of the reference field in the Seal entity to link the artifacts.seal_file_type_title(optional, default:GitHub-Artifacts): Title for the uploaded file type in Seal.
These actions are intended to be called from workflow files (.github/workflows/) in your repositories that need to integrate with Seal. You can use them either by referencing the published Docker image on GitHub Container Registry (GHCR) or by checking out this repository and referencing the action path directly.
Note: Replace placeholder values like YOUR_SEAL_API_BASE_URL, YOUR_SEAL_CHANGE_CONTROL_TEMPLATE_ID, etc., with your actual configuration. Pinning to a specific version tag (e.g., :v1.0.0 for Docker, @v1.0.0 for repo path) is recommended for stability once versions are released.
1. Using Docker Image:
# .github/workflows/codebase_snapshot_image.yml
name: Codebase Snapshot via Image
on:
pull_request:
branches: [ 'main', 'release/*' ] # Adjust trigger branches
permissions:
contents: read
pull-requests: read
packages: read # Required to pull image from GHCR
jobs:
codebase_snapshot_via_image:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create and Upload Seal Snapshot
uses: docker://ghcr.io/opvia/codebase-snapshot-action:latest # Pin to version recommended
with:
seal_api_token: ${{ secrets.SEAL_API_TOKEN }}
seal_api_base_url: 'https://YOUR_SEAL_API_BASE_URL/'
seal_template_id: 'YOUR_SEAL_CHANGE_CONTROL_TEMPLATE_ID'
seal_snapshot_field_name: 'Code Snapshot' # Optional
seal_file_type_title: 'GitHub-CodeSnapshot' # Optional
exclude_patterns: '.git/* node_modules/* build/* dist/*' # Optional
archive_type: 'zip' # Optional (zip or tar)2. Using Repository Path:
# .github/workflows/codebase_snapshot_repo.yml
name: Codebase Snapshot via Repo
on:
pull_request:
branches: [ 'main', 'release/*' ] # Adjust trigger branches
permissions:
contents: read
pull-requests: read
jobs:
codebase_snapshot_via_repo:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Codebase Snapshot Action
uses: opvia/seal-github-actions/.github/actions/codebase-snapshot@main # Pin to version recommended
with:
seal_api_token: ${{ secrets.SEAL_API_TOKEN }}
seal_api_base_url: 'https://YOUR_SEAL_API_BASE_URL/'
seal_template_id: 'YOUR_SEAL_CHANGE_CONTROL_TEMPLATE_ID'
# Optional fields below
# seal_snapshot_field_name: 'Code Snapshot'
# seal_file_type_title: 'GitHub-CodeSnapshot'
# exclude_patterns: '.git/* node_modules/*'
# archive_type: 'zip'1. Using Docker Image:
# .github/workflows/upload_artifacts_image.yml
name: Upload Artifacts via Image
on:
pull_request: # Or release, workflow_dispatch, etc.
branches: [ 'main', 'release/*' ]
permissions:
contents: read
pull-requests: read
packages: read # Required to pull image from GHCR
jobs:
upload_artifacts_via_image:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
# Add your build/artifact generation steps here
# - name: Build Project
# run: npm run build
- name: Upload Artifacts to Seal
uses: docker://ghcr.io/opvia/upload-artifacts-action:latest # Pin to version recommended
with:
seal_api_token: ${{ secrets.SEAL_API_TOKEN }}
seal_api_base_url: 'https://YOUR_SEAL_API_BASE_URL/'
seal_template_id: 'YOUR_SEAL_CHANGE_CONTROL_TEMPLATE_ID'
artifact_patterns: '"dist/**/*.js" "docs/*.pdf"' # Specify patterns
# Optional fields below
# seal_field_name: 'Release Artifacts'
# seal_file_type_title: 'CI-Artifacts'2. Using Repository Path:
# .github/workflows/upload_artifacts_repo.yml
name: Upload Artifacts via Repo
on:
pull_request: # Or release, workflow_dispatch, etc.
branches: [ 'main', 'release/*' ]
permissions:
contents: read
pull-requests: read
jobs:
upload_artifacts_via_repo:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
# Add your build/artifact generation steps here
# - name: Build Project
# run: npm run build
- name: Upload Artifacts to Seal
uses: opvia/seal-github-actions/.github/actions/upload-artifacts@main # Pin to version recommended
with:
seal_api_token: ${{ secrets.SEAL_API_TOKEN }}
seal_api_base_url: 'https://YOUR_SEAL_API_BASE_URL/'
seal_template_id: 'YOUR_SEAL_CHANGE_CONTROL_TEMPLATE_ID'
artifact_patterns: '"dist/**/*.js" "docs/*.pdf"' # Specify patterns
# Optional fields below
# seal_field_name: 'Release Artifacts'
# seal_file_type_title: 'CI-Artifacts'Use Node.js 20 or newer and OpenSSL, then run:
cd .github/actions
npm ci
npm run allThe tests use synthetic files and temporary HTTPS servers on loopback. They exercise the built action bundles, so rebuild before testing source changes. No Seal account or storage credentials are needed.