Skip to content
cloud-lightning

GitHub Action

Run and post run Action

v1.4.1 Latest version

Run and post run Action

cloud-lightning

Run and post run Action

A simple GitHub action that allows you to execute commands on place and in post-run, once a workflow job has ended

Installation

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

              

- name: Run and post run Action

uses: gacts/[email protected]

Learn more about this action in gacts/run-and-post-run

Choose a version

Logo

Run and post run Action

Release version Build Status License

A simple GitHub action that allows you to execute commands on place and in post-run, once a workflow job has ended.

Linked GitHub issue.

Usage

jobs:
  run-some-action:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run this action
        uses: gacts/run-and-post-run@v1
        with:
          run: echo "First"
              "(can be multiline)"
          post: |
            echo "First post"
            echo "(can run multiply commands)"
            ls -la /tmp \
              /bin /opt

      - name: Post command only
        uses: gacts/run-and-post-run@v1
        with:
          post: echo "Second post"

This above configuration will produce the following:

CI output example

Customizing

Inputs

The following inputs can be used as step.with keys:

Name Type Default Required Description
run string or list no A commands that needs to be run in place
post string or list yes A commands that needs to be run once a workflow job has ended
working-directory string no A working directory from which the command needs to be run
shell string bash no A shell to use for executing run commands
post-shell string no A shell to use for executing post commands. Defaults to value of shell

Releasing

To release a new version:

  • Build the action distribution (make build or npm run build).
  • Commit and push changes (including dist directory changes - this is important) to the master|main branch.
  • Publish the new release using the repo releases page (the git tag should follow the vX.Y.Z format).

Major and minor git tags (v1 and v1.2 if you publish a v1.2.Z release) will be updated automatically.

Support

Issues Pull Requests

If you find any errors in the action, please create an issue in this repository.

License

This is open-source software licensed under the MIT License.