Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
github-action-toolkit v0.7.0
github-action-toolkit v0.7.0

Getting started

  • Installation
  • Usage

Usage

  • Print Functions
  • Job Summary
  • Input, Output, Environment Variables & States
  • GitHub Action Event Payload
  • Git and GitHub Repo related Functions
  • Github Artifact related Functions
  • GitHub API Client
  • GitHub Cache Functions
  • Debugging Functions

Development

  • Changelog
  • Contributing
  • License
  • GitHub Repository
Back to top
View this page

Print Functions¶

echo(message, use_subprocess=False)¶

Prints specified message to the action workflow console.

example:

>> from github_action_toolkit import echo

>> echo("Hello World")

# Output:
# Hello World

info(message, use_subprocess=False)¶

Prints specified message to the action workflow console. (Same function as echo())

example:

>> from github_action_toolkit import info

>> info("Hello World-1")

# Output:
# Hello World-1

debug(message, use_subprocess=False)¶

Prints colorful debug message to the action workflow console. GitHub Actions Docs: debug

example:

>> from github_action_toolkit import debug

>> debug("Hello World")

# Output:
# ::debug ::Hello World

notice(message, title=None, file=None, col=None, end_column=None, line=None, end_line=None, use_subprocess=False)¶

Prints colorful notice message to the action workflow console. GitHub Actions Docs: notice

example:

>> from github_action_toolkit import notice

>> notice(
    "test message",
    title="test title",
    file="abc.py",
    col=1,
    end_column=2,
    line=4,
    end_line=5,
)

# Output:
# ::notice title=test title,file=abc.py,col=1,endColumn=2,line=4,endLine=5::test message=

warning(message, title=None, file=None, col=None, end_column=None, line=None, end_line=None, use_subprocess=False)¶

Prints colorful warning message to the action workflow console. GitHub Actions Docs: warning

example:

>> from github_action_toolkit import warning

>> warning(
    "test message",
    title="test title",
    file="abc.py",
    col=1,
    end_column=2,
    line=4,
    end_line=5,
)

# Output:
# ::warning title=test title,file=abc.py,col=1,endColumn=2,line=4,endLine=5::test message

error(message, title=None, file=None, col=None, end_column=None, line=None, end_line=None, use_subprocess=False)¶

Prints colorful error message to the action workflow console. GitHub Actions Docs: error

example:

>> from github_action_toolkit import error

>> error(
    "test message",
    title="test title",
    file="abc.py",
    col=1,
    end_column=2,
    line=4,
    end_line=5,
)

# Output:
# ::error title=test title,file=abc.py,col=1,endColumn=2,line=4,endLine=5::test message

add_mask(value, use_subprocess=False)¶

Masking a value prevents a string or variable from being printed in the workflow console. GitHub Actions Docs: add_mask

example:

>> from github_action_toolkit import add_mask

>> add_mask("test value")

# Output:
# ::add-mask ::test value

start_group(title, use_subprocess=False) and end_group(use_subprocess=False)¶

Creates an expandable group in the workflow log. GitHub Actions Docs: group

example:

>> from github_action_toolkit import echo, start_group, end_group, group

>> start_group("My Group Title")
>> echo("Hello World")
>> end_group()

# Output:
# ::group ::My Group Title
# Hello World
# ::endgroup::

# ====================
# Using Group Context Manager
# ====================

>> with group("My Group Title"):
...   echo("Hello World")

# Output:
# ::group ::My Group Title
# Hello World
# ::endgroup::
Next
Job Summary
Previous
Usage
Copyright © 2025, Vatsal Jagani
Made with Sphinx and @pradyunsg's Furo
On this page
  • Print Functions
    • echo(message, use_subprocess=False)
    • info(message, use_subprocess=False)
    • debug(message, use_subprocess=False)
    • notice(message, title=None, file=None, col=None, end_column=None, line=None, end_line=None, use_subprocess=False)
    • warning(message, title=None, file=None, col=None, end_column=None, line=None, end_line=None, use_subprocess=False)
    • error(message, title=None, file=None, col=None, end_column=None, line=None, end_line=None, use_subprocess=False)
    • add_mask(value, use_subprocess=False)
    • start_group(title, use_subprocess=False) and end_group(use_subprocess=False)