Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/credfeto/action-yaml-format
Reformat YAML files
https://github.com/credfeto/action-yaml-format
Last synced: about 1 month ago
JSON representation
Reformat YAML files
- Host: GitHub
- URL: https://github.com/credfeto/action-yaml-format
- Owner: credfeto
- License: mit
- Created: 2020-09-05T21:16:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-15T03:53:31.000Z (about 2 months ago)
- Last Synced: 2024-11-15T04:26:32.425Z (about 2 months ago)
- Language: Shell
- Size: 2.42 MB
- Stars: 3
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Reformat YAML Files
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
Reformats YAML files
* Removes trailing whitepace
* Converts tabs to spaces## How to use it?
This is a GitHub action, so it has to be added to a GitHub workflow.A simple example of running this action on all pushes to the repository would be
to add a `reformatyaml.yml` file under `.github/workflows` with the following content
```yaml
on: [push]jobs:
reformat-sql:
runs-on: ubuntu-latest
steps:
# Checkout the source code so there are some files to look at.
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Run the reformat action
- name: Reformat YAML Files
uses: credfeto/[email protected]
- name: Commit files
run: |
git config --local user.email "@users.noreply.github.com"
git config --local user.name "YAML Reformat Bot"
git commit --all -m"Reformat YAML Files to common format." || true
- name: Push
run: git push "https://${{github.actor}}:${{secrets.SOURCE_PUSH_TOKEN}}@github.com/${{github.repository}}.git" "HEAD:${{ env.GIT_BRANCH }}"
```On each push, it will reformat the YAML files. Note you'll need to commit and push any commits back to your github repo.
## Contributors