Skip to content

milankomaj/shell-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

shell-x

for example 1 : need time and date in your timezone, localized terminal outputs, sort files or values alfabeticaly...

Composite action for localized github runners.

- uses: milankomaj/shell-x@v0.3

with: required default 2 optional
actor: false ${{ github.actor }}
shell: false 3
locale: false 3
timezone: false 3
comand: 4 false
os:⬇️ shell:➡️ bash sh pwsh cmd powershell custom
ubuntu
windows
macos

minimal example
      - uses: milankomaj/shell-x@v0.3
example for [windows-latest]
      - uses: milankomaj/shell-x@v0.3
        with:
          shell: pwsh
          locale: sk_SK
          timezone: Central Europe Standard Time
          comand: Get-TimeZone && Get-Date -UFormat '%A %d/%m/%Y %R %Z'
example for [ubuntu-latest]
      - uses: milankomaj/shell-x@v0.3
        with:
          shell: bash
          locale: sk_SK.utf8
          timezone: Europe/Bratislava
          comand: cat /etc/timezone && date
example full workflow [ubuntu-latest]
name: test
run-name: ${{ github.workflow }} ✅ ${{ github.actor }} ✅ ${{ github.event_name}}
on:
  workflow_dispatch:
jobs:
  Shell:
    name: Shell
    continue-on-error: false
    strategy:
      max-parallel: 3
      matrix:
       os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: shell-x@v0.3
        id: TEST
        uses: milankomaj/shell-x@v0.3
        with:
          shell: bash
          locale: sk_SK.utf8
          timezone: Europe/Bratislava
          comand: date && timedatectl

      # optional shell-x outputs
      - name: inputs-outputs
        run: echo "::notice::${{ steps.TEST.outputs.inputs-outputs }}"

      - name: shell-outputs
        run: echo "::notice::${{ steps.TEST.outputs.shell-outputs}}"

      - name: comand-outputs
        run: ${{ steps.TEST.outputs.comand-outputs }} && sudo apt -y update && sudo apt -y upgrade

Footnotes

  1. options depend on the runner.os, shell ...

  2. if aren't set

  3. default Github runners and workflow syntax 2 3

  4. run any supported command inside shell-x