Skip to content

AlphaSteam/GHuPrintGen

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GHuPrintGen. Generate a microprint of the logs of a workflow job

The action generates a highly microprint of the logs generated by a job inside a Github workflow.

If the job hasn't finished yet, the logs won't be complete. So it's recommended to create an extra job for generating and committing the generated microprints.

Usage

name: Generate microprint of job

on: 
  push:

jobs:
  work_to_be_logged:
    runs-on: ubuntu-latest

    steps:
      {Your job steps}

  generate_microprint_of_first_job:
    runs-on: ubuntu-latest

    # If the job doesn't finish first, the logs won't be complete.
    needs: work_to_be_logged

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Get microprint of jobs logs
        uses: AlphaSteam/GHuPrintGen@v5
        with: 
            {inputs}


      # Here you can use any action for committing the generated files. But if you don't commit them, they'll be lost.

      - name: Commit microprint
        uses: EndBug/add-and-commit@v9
          with:
            message: Updated custom rules microprint
            pull: '--rebase --autostash'
      

Inputs

None of the inputs are required, though the job_name is highly recommended.

Tables Description Default
repository You can generate microprints of jobs on another repository if needed. By default it expects the job to be on the same repository. ${{github.repository}}
job_name Job that's going to get used for microprint generation. By default it uses the job where the action is called. Not recommended as the logs don't get generated by the GitHub API until the job has finished all it's steps. ${{ github.job }} (Not recommended!)
github_token Personal access token (PAT) used to fetch the logs of the requested job. If the repo is public, it needs the public-repo scope, if not, repo. Learn more about creating and using encrypted secrets ${{ github.token }}
ref Reference to the branch targeted ${{ github.ref }} (Current branch)
save_log Whether or not to save the logs retrieved with the GitHub API as plain text true
log_filename The name of the plain text logs file (Without the extension) logs
log_path The directory where to save the plain text logs file. It saves it in the root of the repository by default. ./
microprint_filename The name of the generated microprint (Without extension). microprint
microprint_path The directory where to save the generated microprint. It saves it in the root of the repository by default. ./
microprint_config_filename The name for the config file (Without extension). config
microprint_config_path The directory where the config.json file is located. This file is in charge of hosting the rules for generating the microprint. ./
generate_microprint_visualizer_link Whether or not to save a file with a generated link to the microprint visualizer true
microprint_visualizer_link_filename The name for the markdown file with the link (Without extension). microprint_visualizer
microprint_visualizer_link_path The directory where the markdown file with the generated link will be saved ./
matrix Matrix values. Only change if you want to hardcode the matrix values. NOT RECOMMENDED. ${{matrix && toJSON(matrix)}}

Microprint generation

The microprint generation is done by the package uPrintGen.

Configuration file

The configuration file is a JSON file that follows the rules specified by uPrintGen. Those are here.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published