Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
illvart committed Nov 22, 2020
0 parents commit b97bb85
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# github: illvart
patreon: illvart
custom: ["https://www.paypal.me/illvart", "https://www.buymeacoffee.com/illvart", "https://saweria.co/illvart"]
18 changes: 18 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- accepted
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in 7 days if no further activity occurs.
To prevent this from happening, leave a comment.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
Closing this issue because it has been marked as stale for more than 7 days.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.9-slim-buster

LABEL "com.github.actions.name"="Bash shell beautifier"
LABEL "com.github.actions.description"="Run beautysh to beautify a bash shell scripts code."
LABEL "com.github.actions.icon"="code"
LABEL "com.github.actions.color"="green"

LABEL "repository"="https://github.com/illvart/beautysh-action"
LABEL "homepage"="https://github.com/illvart/beautysh-action"
LABEL "maintainer"="illvart"

RUN pip install beautysh

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 illvart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Bash shell beautifier

[![Release](https://img.shields.io/github/v/release/illvart/beautysh-action?color=orange)](https://github.com/illvart/beautysh-action/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/illvart/beautysh-action/blob/main/LICENSE)
[![Marketplace](https://img.shields.io/badge/GitHub-Marketplace-blue.svg)](https://github.com/marketplace/actions/bash-shell-beautifier)

A GitHub Action that runs [beautysh](https://github.com/lovesegfault/beautysh) for beautify a bash shell scripts code.

## Usage

To use this action in your repository, create a file like `.github/workflows/ci.yml` with the following example:

```yaml
name: CI

on:
pull_request:
push:
branches:
- master

jobs:
beautify:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Run beautysh
uses: illvart/beautysh-action@latest
with:
# Pass beautysh options in args, for example:
args: '*.sh --indent-size 4'

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[auto] ci: apply beautysh changes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

```

If there is no `args` option it will fallback into `*.sh`.

To avoid errors when project directory doesn't have an `*.sh` file, you can pass it with `&>/dev/null`.

For a full list of possible `args` checkout the [beautysh docs](https://github.com/lovesegfault/beautysh#usage).
20 changes: 20 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Bash shell beautifier'
description: 'Run beautysh to beautify a bash shell scripts code.'
author: 'illvart'

branding:
icon: 'code'
color: 'green'

inputs:
args:
description: 'Arguments provided to beautysh'
required: false
default: '*.sh'

runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.args }}

3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
set -e
sh -c "beautysh $*"

0 comments on commit b97bb85

Please sign in to comment.