Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

security: migrate PyPI publish to Trusted Publishing (OIDC)

オープン
#417 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
github-actions, python

調査の方向性

Start with .github/workflows/publish-pypi.yml and the Trusted Publishing guidance from PyPI and pypa/gh-action-pypi-publish. Check the workflow's permissions, publish environment, and existing PyPI and Test PyPI secrets. Done means publishing uses OIDC with reviewer approval and the long-lived token secrets can be removed after verification.

索引モデルが issue の本文から書いたものです。

説明

Summary

publish-pypi.yml currently authenticates to PyPI using a long-lived PYPI_API_TOKEN repo secret. This is a security risk: if the secret is ever leaked or the repo is compromised, the token can be used to publish arbitrary versions to PyPI indefinitely.

Recommended fix

Migrate to PyPI Trusted Publishing (OIDC), which is supported natively by pypa/gh-action-pypi-publish. With trusted publishing:

  • No long-lived token is stored anywhere
  • PyPI issues a short-lived token scoped to a specific GitHub repo + workflow + environment for each publish run
  • Even if the workflow is triggered unexpectedly, the token expires immediately after use

Steps

  1. On PyPI, add a Trusted Publisher for tabcmd:

    • Owner: tableau
    • Repository: tabcmd
    • Workflow: publish-pypi.yml
    • Environment: pypi-production (create this environment on the repo with required reviewers)
  2. Update publish-pypi.yml:

    • Add permissions: id-token: write to the job
    • Remove password: ${{ secrets.PYPI_API_TOKEN }} from the publish step
    • The action authenticates automatically via OIDC
  3. Add a pypi-production GitHub environment with required reviewer approval as an extra gate.

  4. Delete the PYPI_API_TOKEN repo secret once verified.

Same change can be applied to TEST_PYPI_API_TOKEN / Test PyPI.

References

主要言語
Python
スター
52
フォーク
17
平均マージ
5日 20時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tableau/tabcmd のほかの issue

tableau/tabcmd の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。