Skip to content

Commit

Permalink
refactor: Fix misc (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
ginokent authored Jan 8, 2025
2 parents 09bd5fa + e482ec3 commit b37a484
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .bin/direnv
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ExecProgram() {
exec "${prog_version_exe:?}" "$@" <&0
}

# LICENSE: https://github.com/kunitsucom/log.sh/blob/HEAD/LICENSE
# LICENSE: https://github.com/hakadoriya/log.sh/blob/HEAD/LICENSE
# Common
if [ "${LOGSH_COLOR:-}" ] || [ -t 2 ] ; then LOGSH_COLOR=true; else LOGSH_COLOR=''; fi
_logshRFC3339() { date "+%Y-%m-%dT%H:%M:%S%z" | sed "s/\(..\)$/:\1/"; }
Expand Down
2 changes: 1 addition & 1 deletion .bin/gitleaks
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ExecProgram() {
exec "${prog_version_exe:?}" "$@" <&0
}

# LICENSE: https://github.com/kunitsucom/log.sh/blob/HEAD/LICENSE
# LICENSE: https://github.com/hakadoriya/log.sh/blob/HEAD/LICENSE
# Common
if [ "${LOGSH_COLOR:-}" ] || [ -t 2 ] ; then LOGSH_COLOR=true; else LOGSH_COLOR=''; fi
_logshRFC3339() { date "+%Y-%m-%dT%H:%M:%S%z" | sed "s/\(..\)$/:\1/"; }
Expand Down
4 changes: 2 additions & 2 deletions .bin/go-mod-all
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set -Eeu -o pipefail

REPO_ROOT=$(git rev-parse --show-toplevel)

# LICENSE: https://github.com/kunitsucom/log.sh/blob/HEAD/LICENSE
# LICENSE: https://github.com/hakadoriya/log.sh/blob/HEAD/LICENSE
# Common
if [ "${LOGSH_COLOR:-}" ] || [ -t 2 ]; then LOGSH_COLOR=true; else LOGSH_COLOR=''; fi
if [ "${LOGSH_COLOR:-}" ] || [ -t 2 ] ; then LOGSH_COLOR=true; else LOGSH_COLOR=''; fi
_logshRFC3339() { date "+%Y-%m-%dT%H:%M:%S%z" | sed "s/\(..\)$/:\1/"; }
_logshCmd() { for a in "$@"; do if echo "${a:-}" | grep -Eq "[[:blank:]]"; then printf "'%s' " "${a:-}"; else printf "%s " "${a:-}"; fi; done | sed "s/ $//"; }
# Color
Expand Down
2 changes: 1 addition & 1 deletion .bin/golangci-lint
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ExecProgram() {
exec "${prog_version_exe:?}" "$@" <&0
}

# LICENSE: https://github.com/kunitsucom/log.sh/blob/HEAD/LICENSE
# LICENSE: https://github.com/hakadoriya/log.sh/blob/HEAD/LICENSE
# Common
if [ "${LOGSH_COLOR:-}" ] || [ -t 2 ] ; then LOGSH_COLOR=true; else LOGSH_COLOR=''; fi
_logshRFC3339() { date "+%Y-%m-%dT%H:%M:%S%z" | sed "s/\(..\)$/:\1/"; }
Expand Down
2 changes: 1 addition & 1 deletion .bin/typos
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ ExecProgram() {
exec "${prog_version_exe:?}" "$@" <&0
}

# LICENSE: https://github.com/kunitsucom/log.sh/blob/HEAD/LICENSE
# LICENSE: https://github.com/hakadoriya/log.sh/blob/HEAD/LICENSE
# Common
if [ "${LOGSH_COLOR:-}" ] || [ -t 2 ] ; then LOGSH_COLOR=true; else LOGSH_COLOR=''; fi
_logshRFC3339() { date "+%Y-%m-%dT%H:%M:%S%z" | sed "s/\(..\)$/:\1/"; }
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/final-newline-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: final-newline-checker

on:
pull_request:
# NO paths filter

jobs:
final-newline-checker:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: hakadoriya-actions/[email protected]
id: final-newline-checker
with:
# NOTE: If you want to fail on missing final newline, set this to true
#fail-on-missing: true
#paths: |-
# ^action.yml
# ^missing-final-newline.md
paths-ignore: |-
.*\.ico$
.*\.png$
- name: Submit PR comment if missing final newline
if: ${{ steps.final-newline-checker.outputs.missing == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
# Create comment body
cat <<EOF | perl -pe 's/\\n/\n/g' | tee /tmp/gh-pr-comment-body.md
## 🚨 Missing final newline
The following files are missing final newline.
\`\`\`
${{ steps.final-newline-checker.outputs.missing-files }}
\`\`\`
EOF
# Submit PR comment
gh pr comment ${{ github.event.pull_request.number }} --body-file /tmp/gh-pr-comment-body.md
# fail the workflow
exit 1
2 changes: 1 addition & 1 deletion .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
outputs:
skip: ${{ steps.paths-filter.outputs.skip }}
steps:
- uses: hakadoriya/github-actions-[email protected]
- uses: hakadoriya-actions/[email protected]
id: paths-filter
with:
paths: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-mod-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
outputs:
skip: ${{ steps.paths-filter.outputs.skip }}
steps:
- uses: hakadoriya/github-actions-[email protected]
- uses: hakadoriya-actions/[email protected]
id: paths-filter
with:
paths: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
outputs:
skip: ${{ steps.paths-filter.outputs.skip }}
steps:
- uses: hakadoriya/github-actions-[email protected]
- uses: hakadoriya-actions/[email protected]
id: paths-filter
with:
paths: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/task-list-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
contents: read
pull-requests: read
steps:
- uses: hakadoriya/github-actions-[email protected]
- uses: hakadoriya-actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 kunitsucom
Copyright 2022 hakadoriya

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit b37a484

Please sign in to comment.