Skip to content

Commit

Permalink
Add package.json to track metadata and format repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitschpatrol committed Sep 8, 2024
1 parent 733d4f8 commit 81b84ef
Show file tree
Hide file tree
Showing 9 changed files with 1,098 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/sync-metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Overwrite GitHub repo metadata with info from package.json
on:
push:
branches: [main]
workflow_dispatch:

jobs:
build:
name: Sync Metadata
runs-on: ubuntu-latest
env:
IS_VALID_TOKEN: false
HAS_PACKAGE: false

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for package.json
run: |
if [ -f package.json ]; then
echo "📦 Found package.json"
echo "HAS_PACKAGE=true" >> $GITHUB_ENV
else
echo "❌ This action requires a package.json to run"
echo "HAS_PACKAGE=false" >> $GITHUB_ENV
fi
- name: Validate Access Token
if: env.HAS_PACKAGE == 'true'
run: |
if [ -z ${{ secrets.PERSONAL_ACCESS_TOKEN }} ]; then
echo "❌ This action requires a Personal Access token to run"
echo "IS_VALID_TOKEN=false" >> $GITHUB_ENV
else
echo "🔑 Authenticated with Personal Access token"
echo "IS_VALID_TOKEN=true" >> $GITHUB_ENV
fi
- name: Sync Package info to GitHub
if: env.IS_VALID_TOKEN == 'true' && env.HAS_PACKAGE == 'true'
uses: kitschpatrol/github-action-repo-sync@v2
with:
TYPE: npm
PATH: package.json
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Git Ignore
# Also used by CSpell and Stylelint

# @kitschpatrol/repo-config boilerplate
.astro/
.DS_Store
.env
.env.*
!.env.example
.svelte-kit/
{tmp,temp}/
**/*.min.js
/scratch/
bower_components/
build/
coverage/
dist/
node_modules/
vendor/

# Customizations
10 changes: 10 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
publish-branch=main

# Required for using @kitschpatrol/shared-config with pnpm
public-hoist-pattern[]=@kitschpatrol/repo-config
public-hoist-pattern[]=*cspell*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*mdat*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=*remark*
public-hoist-pattern[]=*stylelint*
23 changes: 23 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Prettier Ignore
# Does not inherit from .gitignore

# @kitschpatrol/repo-config boilerplate
.astro/
.DS_Store
.svelte-kit/
{tmp,temp}/
**/*.min.js
/scratch/
bower_components/
build/
coverage/
dist/
node_modules/
vendor/

# @kitschpatrol/prettier-config boilerplate
pnpm-lock.yaml
package-lock.json

# Customizations
main.rb
25 changes: 25 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import sharedConfig from '@kitschpatrol/prettier-config'

/** @type {import("prettier").Config} */
const localConfig = {
// Config overrides
overrides: [
...sharedConfig.overrides,
{
files: '*.sh',
options: {
useTabs: false,
},
},
{
files: ['*.md'],
options: {
singleQuote: false,
},
},
],
}
export default {
...sharedConfig,
...localConfig,
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode"]
}
36 changes: 36 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
".env": ".env.*",
"package.json": ".*.cjs, .*.js, .*.json, .*.mjs, .*.toml, .*.ts, .*.yaml, .*.yml, .*ignore, .*rc, *config.cjs, *config.js, *config.json, *config.mjs, *config.toml, *config.ts, *config.yaml, *config.yml, lerna.json, netlify.toml, package-lock.json, , pnpm*, turbo.json, vercel.json, workspace*, wrangler.toml, yarn.lock, yarn*",
"readme.md": "authors*, backers*, changelog*, citation*, code_of_conduct*, contributing*, contributors*, copying*, credits*, governance*, history*, license*, maintainers*, release_notes*, security*, sponsors*"
},
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[gitignore]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[ruby]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[shellscript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.documentSelectors": [
"**/.eslintignore",
"**/.node-version",
"**/.npmrc",
"**/.prettierignore",
"**/*.astro",
"**/*.rb",
"**/*.svelte"
],
"prettier.enable": true
}
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "github-action-release-changelog",
"type": "module",
"description": "GitHub Action for generating a changelog of all the git commits between the new tag and the latest tags.",
"repository": {
"type": "git",
"url": "git+https://github.com/kitschpatrol/github-action-release-changelog.git"
},
"homepage": "https://github.com/kitschpatrol/github-action-release-changelog",
"license": "MIT",
"private": true,
"packageManager": "[email protected]",
"engines": {
"node": ">=22.0.0",
"pnpm": ">=9.0.0"
},
"keywords": [
"github-action",
"action",
"cask",
"homebrew"
],
"scripts": {
"fix": "pnpm prettier-config --fix",
"lint": "pnpm prettier-config --check",
"updatetag": "git tag -d v2 && git push origin :v2 && git tag -a v2 -m '' && git push origin v2"
},
"devDependencies": {
"@kitschpatrol/prettier-config": "^4.7.5"
}
}
Loading

0 comments on commit 81b84ef

Please sign in to comment.