Skip to content

Sets up ~/.bash_profile for stricter error handling and more detailed error reporting.

License

Notifications You must be signed in to change notification settings

release-engineers/action-setup-bash

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

release-engineers/action-setup-bash

Status: Production ready

action-setup-bash sets up ~/.bash_profile for stricter error handling and more detailed error reporting.

Usage

Refer to the example workflow;

name: Example

on:
  workflow_dispatch:

defaults:
  run:
    shell: bash --login {0}

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: release-engineers/action-setup-bash@v1
      - run: |
          echo "With the default shell set to bash --login, 'run' steps in this GitHub Workflow run ~/.bash_profile"
          echo "Any errors that occur after the setup action will be more detailed and halt the workflow"
          echo "Time to crash;"
          exit 1

Bash Profile

To see what's added to bash_profile, refer to bash_profile.sh;

#!/usr/bin/env bash

set -e -o pipefail -o errtrace -o functrace

trap_error_report() {
  lineno=$1
  command=$2
  echo "GitHub Workflow erred in bash at line $lineno on command: $command" >&2
}

trap 'trap_error_report "${LINENO}" "${BASH_COMMAND}"' ERR

About

Sets up ~/.bash_profile for stricter error handling and more detailed error reporting.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages