Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

feat: サプライチェーン攻撃対策(github actions, pnpm) - #9

Closed
naoyashiga wants to merge 7 commits into
mainfrom
feature/naoyashiga-supply-chain-fix
Closed

feat: サプライチェーン攻撃対策(github actions, pnpm)#9
naoyashiga wants to merge 7 commits into
mainfrom
feature/naoyashiga-supply-chain-fix

Conversation

@naoyashiga

@naoyashiga naoyashiga commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • actions/checkout を v3 → v6.0.2 にアップデートし、commit SHA でピン留め
  • actions/setup-node を v3 → v6.3.0 にアップデートし、Node.js を 18.x → 25.9.0 に変更、commit SHA でピン留め
  • stefanzweifel/git-auto-commit-action を v4 → v7.1.0 にアップデートし、commit SHA でピン留め

Test plan

  • CI が正常に通ることを確認

🤖 Generated with Claude Code

参考

Comment thread .github/workflows/ci.yml
steps:
- name: Checkout codes
uses: actions/checkout@v3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/workflows/ci.yml

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/workflows/ci.yml

- name: Publish docs
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naoyashiga naoyashiga self-assigned this Apr 10, 2026
@naoyashiga naoyashiga changed the title feat: GitHub Actions を commit SHA でピン留めしてバージョンアップ feat: サプライチェーン攻撃対策(github actions, pnpm) Apr 10, 2026
@naoyashiga

naoyashiga commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator Author
スクリーンショット 2026-04-10 12 56 45

このレポジトリのsecrets.NPM_TOKENがおそらくexpired(有効期限2026 02)になっており、CIが失敗する。
https://github.com/plaidev/karte-action-sdk-docs/actions/runs/24223995153/job/70721196692?pr=9

slackスレ、granular access tokensを使っているっぽい
https://plaidinc.slack.com/archives/CM75QQUN4/p1681094088657859?thread_ts=1681091949.465349&cid=CM75QQUN4

@naoyashiga

Copy link
Copy Markdown
Collaborator Author

ワークフローの GitHub Packages レジストリに対して認証済み操作を行うために、GITHUB_TOKEN を使用することができます。

npm tokenだと管理が大変なので、GITHUB_TOKENを使うようにしてみる。
https://docs.github.com/ja/actions/tutorials/publish-packages/publish-nodejs-packages#authenticating-to-the-destination-repository

@naoyashiga

Copy link
Copy Markdown
Collaborator Author

パッケージが plaidev/karte-io-systems リポジトリに属しているのでGITHUB_TOKENを使っても404になる
https://github.com/plaidev/karte-action-sdk-docs/actions/runs/24227457313/job/70731568831?pr=9#step:5:13

@naoyashiga

Copy link
Copy Markdown
Collaborator Author

secrets.NPM_TOKENを使う方式に戻した

@naoyashiga

Copy link
Copy Markdown
Collaborator Author
スクリーンショット 2026-04-10 14 34 21 npm tokenを新規で作成しようとしたらTrusted Publishing推奨というアラートが出てきた。

@naoyashiga

naoyashiga commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator Author

trusted publishingのドキュメント
https://docs.npmjs.com/trusted-publishers#configuring-trusted-publishing

trusted publishingはpublishのときに使う。アラートメッセージが出ているけど今回のinstallだけの用途ではgranular access tokensを使う。

@naoyashiga

naoyashiga commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator Author

Comment thread .github/workflows/ci.yml

- name: Setup npmrc
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kazupon karte-action-sdk-docsレポジトリのサプライチェーン攻撃対策を行っているのですが、質問させてください。

github actions上でgithub packageの「karte-action-sdk」をinstallするときに使うsecrets.NPM_TOKENが何のトークンなのかご存知だったりしますか?

試したこと

  • 最初npm.jsの管理画面上にある「karte-action-sdk-from-ci」というトークンかと思って有効期限が切れていたので新規にトークン作成したところ403が出てinstallできませんでした。
  • github orgのPersonal access tokenも確認しましたが「NPM_TOKEN」はありませんでした

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「karte-action-sdk」をinstallするときに使うsecrets.NPM_TOKENが何のトークンなのかご存知だったりしますか?

npm registryに登録されている当時 private だった? karte-action-sdkをインストールするためのnpm で発行した token だと思います。

この repository 、io-systems側で action-sdk を npm publish した後、github action の外部 repository dispatch 経由で、この repositoryの github action がキックされて動作します。
この github action が動作すると、npm publish された action-sdk をインストールしてドキュメントを生成して github pagesで公開してたはずです。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下記URLのエレメントビルダーに今はないので、このrepo自体必要なかったら削除してしまってもいいと思います。
https://support.karte.io/post/67aMq2qoqXQMw6WaDL22Vl

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確かにエレメントビルダー停止を考えるとレポジトリ自体不要にすることもできそう。

フレックスエディタの共通コード設定で使えるkarte-action-sdkの仕様の参照先として何かしらのドキュメントがほしいというケースはありそう。このへんはcurtisさんにも聞いてみる。

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naoyashiga

Copy link
Copy Markdown
Collaborator Author

アーカイブすることになったのでこのPRはクローズします。
https://plaidinc.slack.com/archives/C0934PXL1DL/p1776050555628029?thread_ts=1776045256.982299&cid=C0934PXL1DL

@naoyashiga naoyashiga closed this Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants