Skip to content

Commit

Permalink
chore: add initial files
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Dec 28, 2023
1 parent 3b5921f commit bc34cd6
Show file tree
Hide file tree
Showing 36 changed files with 4,015 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{cjs,cpp,dart,htm,html,js,json,json5,jsx,mjs,pu,puml,rb,ts,tsx,vue,yaml,yml}]
indent_size = 2
indent_style = space

[*.{go,gradle,py}]
indent_size = 4
indent_style = space

[*.sh]
indent_size = 8
indent_style = space

[*.md]
max_line_length = off
trim_trailing_whitespace = false

[{Makefile,*.mk}]
indent_style = tab
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
* text=auto

*.vcproj text eol=crlf

*.cjs text eol=lf
*.cpp text eol=lf
*.dart text eol=lf
*.htm text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.json5 text eol=lf
*.jsx text eol=lf
*.mjs text eol=lf
*.pu text eol=lf
*.puml text eol=lf
*.rb text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.vue text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.go text eol=lf
*.gradle text eol=lf
*.py text eol=lf
*.md text eol=lf
30 changes: 30 additions & 0 deletions .github/workflows/add-issue-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Add issue to github project

on:
workflow_call:
inputs:
target_organization:
required: false
type: string
label:
required: false
type: string
default: project
secrets:
GH_PROJECT_URL:
required: true
GH_TOKEN:
required: false

jobs:
add-to-project:
if: ${{ !inputs.target_organization || github.repository_owner == inputs.target_organization }}
runs-on: ${{ (!github.event.repository.private && 'ubuntu-latest') || fromJSON('["self-hosted", "medium"]') }}
env:
FORCE_COLOR: 3
steps:
- uses: actions/[email protected]
with:
project-url: ${{ secrets.GH_PROJECT_URL }}
github-token: ${{ secrets.GH_TOKEN }}
labeled: ${{ inputs.label }}
36 changes: 36 additions & 0 deletions .github/workflows/close-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Add close comment

on:
workflow_call:
inputs:
target_organization:
required: false
type: string

jobs:
close-comment:
if: ${{ !inputs.target_organization || github.repository_owner == inputs.target_organization }}
runs-on: ${{ (!github.event.repository.private && 'ubuntu-latest') || fromJSON('["self-hosted", "medium"]') }}
env:
FORCE_COLOR: 3
steps:
- run: |
branchNumber=${{github.head_ref}}
branchNumber=($(echo $branchNumber | tr "_" "-"))
branchNumber=($(echo $branchNumber | tr "-" "\n"))
re='^[0-9]+$'
if [[ $branchNumber =~ $re ]]; then
comment=$(curl \
-H "Accept:application/vnd.github+json" \
-H "Authorization:token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }} )
commentBody=$(echo $comment | jq .body)
commentBody=$(echo $commentBody | tr -d "\"")
newBody="close #$branchNumber\r\n$commentBody"
curl \
-X PATCH \
-H "Accept:application/vnd.github+json" \
-H "Authorization:token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }} \
-d "{\"body\": \"${newBody}\"}"
fi
31 changes: 31 additions & 0 deletions .github/workflows/debug-echo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Show a given text (self-hosted)

on:
workflow_call:
inputs:
cpu_arch:
required: false
type: string
github_hosted_runner:
required: false
type: boolean
text:
required: true
type: string
outputs:
text:
value: ${{ jobs.echo.outputs.text }}

jobs:
echo:
runs-on: self-hosted
env:
FORCE_COLOR: 3
outputs:
text: ${{ steps.echo.outputs.text }}
steps:
- uses: actions/checkout@v4
- uses: willbooster/asdf-actions/install@main
- id: echo
run: |
echo "text=${{ inputs.text }}" >> $GITHUB_OUTPUT
15 changes: 15 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Debug

on:
workflow_call:

jobs:
debug:
runs-on: ${{ (!github.event.repository.private && 'ubuntu-latest') || fromJSON('["self-hosted", "medium"]') }}
env:
FORCE_COLOR: 3
steps:
- uses: actions/checkout@v4
- run: |
pwd
ls -al
Loading

0 comments on commit bc34cd6

Please sign in to comment.