Skip to content

Commit

Permalink
baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Nov 13, 2023
1 parent 77c1b55 commit 131809c
Show file tree
Hide file tree
Showing 12 changed files with 300 additions and 101 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/action-release.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/publish-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: publish-action
on:
release:
types: released
concurrency: ${{ github.workflow }}
jobs:
publish-action:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- run: npm ci
- run: npm run build
- run: rm -rf node_modules
- run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- run: git add -Af && git commit -m 'npm run build'
- run: git tag -f "$TAG" && git push -f origin "$TAG"
env:
TAG: ${{ github.event.release.tag_name }}
- uses: actions/[email protected]
with:
source-tag: ${{ github.event.release.tag_name }}
39 changes: 39 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test action
on:
push:
branches: "main"
paths-ignore:
- README.md
- LICENSE
- .gitignore
- .github/**
- "!.github/workflows/test-action.yml"
pull_request:
paths-ignore:
- README.md
- LICENSE
- .gitignore
- .github/**
- "!.github/workflows/test-action.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-action:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- run: npm install
- run: npm run build
- id: main
uses: ./
- shell: jq -C . {0}
run: ${{ toJSON(steps.main.outputs) }}
17 changes: 0 additions & 17 deletions .github/workflows/test.yml

This file was deleted.

131 changes: 130 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,130 @@
node_modules
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
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) 2023 Jacob Hummer

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.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Setup Git environment

<table align=center><td>

```yml
- run: git commit --message 'Automated changes'
# ❌ Please tell me who you are.
# Run
# git config --global user.email "[email protected]"
# git config --global user.name "Your Name"
```

<tr><td>

```yml
- uses: actions4git/setup-git@v1
- run: git commit --message 'Automated changes'
# ✅ Committed 3 files
```

</table>

🔢 Lets you pick a specific version of Git to use (if needed) \
⚡ Defaults to using the system version of Git \
📂 Lets you add additional [safe directories] \
🔑 Properly configures Git to use the `github.token` by default \
👤 Sets up <b>@github-actions\[bot\]</b> as the default Git author

## Usage

![Bun](https://img.shields.io/static/v1?style=for-the-badge&message=Bun&color=000000&logo=Bun&logoColor=FFFFFF&label=)
![GitHub Actions](https://img.shields.io/static/v1?style=for-the-badge&message=GitHub+Actions&color=2088FF&logo=GitHub+Actions&logoColor=FFFFFF&label=)

```yml
on: push
jobs:
job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions4git/setup-git@v1
- run: npx --yes prettier --write .
- run: git add --all
- run: git commit --message 'Prettier'
- run: git push
```
19 changes: 8 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: Setup Git user
description: Sets the Git user and email to enable committing
author: Federico Brigante
name: Setup Git environment
description:

branding:
icon: chevron-up
color: yellow
icon: settings
color: orange

runs:
using: composite
steps:
- shell: bash
run: |
git config user.name "GitHub Actions"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
using: node20
main: dist/main.js

9 changes: 0 additions & 9 deletions license

This file was deleted.

27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"type": "module",
"devDependencies": {
"bun-types": "latest",
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@actions/tool-cache": "^2.0.1",
"@octokit/auth-unauthenticated": "^5.0.1",
"@types/node": "^20.9.0",
"execa": "^8.0.1",
"yaml": "^2.3.4"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"scripts": {
"build": "vite build"
},
"bundleDependencies": [
"@actions/core",
"@actions/github",
"@actions/tool-cache",
"@octokit/auth-unauthenticated",
"execa",
"yaml"
]
}
Loading

0 comments on commit 131809c

Please sign in to comment.