Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup update workflow #12

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ name: Test
on:
workflow_dispatch:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
test-node-versions:
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,27 @@ jobs:
run: |
pnpm up

- name: Gen Body
- name: Fix Samples
run: |
echo 'git_body<<DIFF' >> $GITHUB_ENV
git --no-pager diff --compact-summary >> $GITHUB_ENV
echo 'DIFF' >> $GITHUB_ENV
cd samples
pnpm add ..

- name: PR Body
id: body
uses: streetsidesoftware/actions/public/pr-body@v1
with:
title: 'Workflow Bot -- Update ALL Dependencies'
path: >-
package.json
README.md

- name: PR
uses: streetsidesoftware/actions/.github/actions/pr@v1
with:
commit-message: '${{ env.PR_TYPE }}: Workflow Bot -- Update ALL Dependencies'
commit-message: '${{ env.PR_TYPE }}: ${{ steps.body.outputs.title }}'
branch: ${{ env.NEW_BRANCH }}
base: ${{ env.REF_BRANCH }}
title: '${{ env.PR_TYPE }}: Workflow Bot -- Update ALL Dependencies (${{ env.REF_BRANCH }})'
body: ${{ env.git_body }}
title: '${{ env.PR_TYPE }}: ${{ steps.body.outputs.title }} (${{ env.REF_BRANCH }})'
body: ${{ steps.body.outputs.body }}
app_id: ${{ secrets.AUTOMATION_APP_ID }}
app_private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
16 changes: 8 additions & 8 deletions .github/workflows/update-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ jobs:
pnpm build
pnpm lint:fix

- name: Gen Body
run: |
echo 'git_body<<DIFF' >> $GITHUB_ENV
git --no-pager diff --compact-summary >> $GITHUB_ENV
echo 'DIFF' >> $GITHUB_ENV
- name: PR Body
id: body
uses: streetsidesoftware/actions/public/pr-body@v1
with:
title: 'Workflow Bot -- Fix Lint'

- name: PR
uses: streetsidesoftware/actions/.github/actions/pr@v1
with:
commit-message: '${{ env.PR_TYPE }}: Workflow Bot -- Fix Lint'
commit-message: '${{ env.PR_TYPE }}: ${{ steps.body.outputs.title }}'
branch: ${{ env.NEW_BRANCH }}
base: ${{ env.REF_BRANCH }}
title: '${{ env.PR_TYPE }}: Workflow Bot -- Fix Lint (${{ env.REF_BRANCH }})'
body: ${{ env.git_body }}
title: '${{ env.PR_TYPE }}: ${{ steps.body.outputs.title }} (${{ env.REF_BRANCH }})'
body: ${{ steps.body.outputs.body }}
app_id: ${{ secrets.AUTOMATION_APP_ID }}
app_private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
46 changes: 46 additions & 0 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ' 📄 Update Readme'

on:
workflow_dispatch:
inputs:
base:
description: The Base Ref to apply the diff
required: false
default: 'main'
push:
branches: ['main']

jobs:
update-readme:
runs-on: ubuntu-latest
env:
NEW_BRANCH: readme-${{ inputs.base || 'main' }}
REF_BRANCH: ${{ inputs.base || 'main' }}
PR_TYPE: ci
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.REF_BRANCH }}
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: |
pnpm build
pnpm update-readme

- name: PR Body
id: body
uses: streetsidesoftware/actions/public/pr-body@v1
with:
title: 'Workflow Bot -- Update README.md Examples'

- name: PR
uses: streetsidesoftware/actions/.github/actions/pr@v1
with:
commit-message: '${{ env.PR_TYPE }}: ${{ steps.body.outputs.title }}'
branch: ${{ env.NEW_BRANCH }}
base: ${{ env.REF_BRANCH }}
title: '${{ env.PR_TYPE }}: ${{ steps.body.outputs.title }} (${{ env.REF_BRANCH }})'
body: ${{ steps.body.outputs.body }}
app_id: ${{ secrets.AUTOMATION_APP_ID }}
app_private_key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
4 changes: 0 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[sS]amples/
[tT]emp/
**/dist/**
**/node_modules/**
Expand All @@ -8,7 +7,4 @@
**/.docusaurus/**
CHANGELOG.md
coverage
cspell.json
**/*.schema.json
/fixtures-output/**
.release-please-manifest.json
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"eslint": "eslint .",
"eslint:fix": "eslint . --fix",
"spell": "cspell --no-progress .",
"run:samples": "cd samples && pnpm i && pnpm run:samples",
"run:samples": "cd samples && pnpm add .. && pnpm run:samples",
"update-readme": "pnpm run:samples && inject-markdown README.md"
},
"keywords": [
Expand All @@ -32,7 +32,7 @@
"devDependencies": {
"@eslint/js": "^8.56.0",
"@tsconfig/node18": "^18.2.2",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitest/coverage-istanbul": "^1.2.2",
"cspell": "^8.3.2",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions samples/histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const data = [
['one', 1],
['two', 2],
['three', 3],
['four', 4],
['2.5', 2.5],
];
const hist = histogram(data, { width: 40, maxLabelWidth: 5, title: 'Numbers', headers: ['Label', 'Value'] });
console.log(hist);