% perl -ML -E 'say String::Random->new->randregex("[0-9a-zA-Z]{12}")'
「ソンムーさん最近Perl書いてないでしょ」って言われたけど、多分今年の頭にちょっとだけ書いたPerlコードの中で気に入っているのがこれで、正規表現のeオプションの中でwget呼んでいるという荒業。 pic.twitter.com/Hl09XEozmv
— songmu (@songmu) August 8, 2023
miyagawaさん由来! (?)
リポジトリが以下の構成になっていればいい。
.
├── articles/ # 単独記事
└── books/ # 本
あとはzennの画面から連携設定できる。pushしたら自動反映。
https://github.com/Songmu/zenn.dev
.
├── articles
│ └── hogenoge.md
└── books
└── ghq-handbook
├── 01-introduction.md
├── 02-basic-usage.md
├── 03-command-root.md
├── 04-command-get.md
├── 05-command-list.md
├── 06-command-create.md
├── 07-bulk-ghq-get.md
├── 08-ghq-roadmap.md
└── config.yaml
% npm install -g zenn-cli
% zenn init
% zenn preview # 便利
[-_a-z0-9]{12,}
ghq-handbookが更新されたら、その内容をzenn.devにpushするように
公開されているカスタムアクションで簡単に実現。
https://github.com/cpina/github-action-push-to-another-repository
name: push to zenn
on:
push:
branches: [master]
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT }}
with:
destination-github-username: Songmu
destination-repository-name: zenn.dev
target-branch: main
source-directory: ja
target-directory: books/ghq-handbook
OSS活動を支援してくれると嬉しいです。