Skip to content

airbytehq/upload-logs-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Upload GitHub Workflow Logs to a cloud bucket

A reusable GitHub Action that downloads workflow logs and uploads them to a GCP bucket.

Prerequisites

  1. GitHub App: Create a GitHub App with the following permissions:

    • Repository permissions: actions:read, contents:read
    • Install the app on repositories where you want to use this action
  2. GCP Service Account: Create a service account with permissions to write to Cloud Storage

    • Set up Workload Identity Federation for keyless authentication
  3. GCP Bucket: Create a Cloud Storage bucket (or use the Terraform in this project)

Usage

As a step in an existing workflow (recommended)

jobs:
  my-job:
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      id-token: write

    steps:
      # Your workflow steps here
      - name: Build
        run: make build

      # Upload logs at the end
      - name: Upload logs
        if: always()
        uses: airbytehq/upload-logs-action@v1
        with:
          gcp-workload-identity-provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
          gcp-service-account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
          gcp-bucket-uri: 'gs://my-bucket/prefix/'
          github-app-id: ${{ secrets.GH_APP_ID }}
          github-app-private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

Inputs

Input Description Required Default
gcp-workload-identity-provider GCP Workload Identity Provider Yes -
gcp-service-account GCP Service Account email Yes -
gcp-bucket-uri GCP bucket URI for storing logs (gs://bucket-name/path/) Yes -
github-app-id GitHub App ID for authentication Yes -
github-app-private-key GitHub App private key Yes -
workflow-run-id Workflow run ID to download logs from No ${{ github.run_id }}
workflow-name Workflow name for log file naming No ${{ github.workflow }}
compress Compress logs with gzip before upload No true

Secrets Setup

Add the following secrets to your repository:

  • GCP_WORKLOAD_IDENTITY_PROVIDER: The full identifier for your Workload Identity Provider
  • GCP_SERVICE_ACCOUNT: Email of the service account
  • GCP_LOGS_BUCKET_URI: GCS bucket URI (e.g., gs://my-bucket/logs/)
  • GH_APP_ID: Your GitHub App ID
  • GH_APP_PRIVATE_KEY: Your GitHub App's private key (PEM format)

License

Elastic License 2.0

About

Upload GitHub Workflow Logs to the cloud

Resources

License

Stars

Watchers

Forks

Packages

No packages published