Skip to content
play

GitHub Action

Retrieve Workflow Logs Action

v0.1.0 Latest version

Retrieve Workflow Logs Action

play

Retrieve Workflow Logs Action

Play regex against log file in order to see if error are matched

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Retrieve Workflow Logs Action

uses: Superbasil3/[email protected]

Learn more about this action in Superbasil3/retrieve-workflow-logs-action

Choose a version

Retrieve-workflow-logs Action

This action is used to retrieve the logs of the workflow that has triggered it. It works for jobs triggers by the workflow_run event.

Inputs

github-token

Required GitHub token with permission to read (default permission is enough). Default none.

path-logs

Not Required Where the logs will be left, default to : process.cwd() + '/logs'

  • Make sure the folder where you want the file is not deleted between steps

keep-only-error-files

Not Required If you want to keep only the error files (steps that failed), default to : true

Outputs

path-logs The value from the input path-logs, or the default one

Example usage

name: retrieve-logs 
on:
  workflow_run:  # Triggered when a workflow is triggered
    workflows: ["pr-validation"] # The workflow that triggers this one, can be multiple
    types:
      - completed # The logs are available only when the workflow is completed

jobs:
  retrive_workflow_logs:
    runs-on: ubuntu-latest
    name: retrieve_logs
    steps:
      - name: retrieve_workflow_logs_action
        id: retrieve_workflow_logs_action
        uses: Superbasil3/retrieve-workflow-logs-action@draft
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          keep-only-error-files: true