Skip to content

main()

main() is called from run():


github_custom_actions.ActionBase.run()

Run the action.

run() calls the main() method of the action with the necessary boilerplate to catch and report exceptions.

Usage:

if __name__ == "__main__":
    MyAction().run()

main() is where you implement the business logic of your action.

Source code in src/github_custom_actions/action_base.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
def run(self) -> None:
    """Run the action.

    `run()` calls the `main()` method of the action with the necessary boilerplate to catch and
    report exceptions.

    Usage:
    ```python
    if __name__ == "__main__":
        MyAction().run()
    ```

    `main()` is where you implement the business logic of your action.
    """
    try:
        self.main()
    except Exception:  # noqa: BLE001
        traceback.print_exc(file=sys.stderr)
        sys.exit(1)