Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e publish to test.pypi.org on release #77

Merged

Conversation

tdpreece
Copy link
Contributor

Adds GitHub Actions workflow that will publish this package to
test.pypi.org on release. If successful we can change this to push to
the real pypi.org.

Setup that needs to be done before this is merged:
[ ] login to https://test.pypi.org and create a token for this project
[ ] add a GitHub secret for this token with the name TEST_PYPI_PASSWORD

Once merged we can create a release that will push to test.pypi by:

I had some security concerns around this approach but they are mitigated
by GitHub's controls (described below).

Threat 1: Someone could submit a pull request that leaks your tokens
(e.g. add a line like print(os.environ['SECRET_TOKEN'])).
Control: GitHub run all pull request workflows raised repository
forks with no access to secrets, see
https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/

Threat 2: Someone could submit a pull request that alters the
publish.yml workflow so that it publishes on the pull_request event
instead of the release created event.
Control: same as for Threat 1.

Adds GitHub Actions workflow that will publish this package to
test.pypi.org on release. If successful we can change this to push to
the real pypi.org.

Setup that needs to be done before this is merged:
[ ] login to https://test.pypi.org and create a token for this project
[ ] add a GitHub secret for this token with the name TEST_PYPI_PASSWORD

Once merged we can create a release that will push to test.pypi by:
* browsing to https://github.com/approvals/ApprovalTests.Python
* "Releases" > "Draft a new release"
* entering a new tag version in the box
* clicking "Publish release"
* click the "actions" tab to see how the workflows went
* check https://test.pypi.org/project/approvaltests/ for new version

I had some security concerns around this approach but they are mitigated
by GitHub's controls (described below).

Threat 1: Someone could submit a pull request that leaks your tokens
(e.g. add a line like print(os.environ['SECRET_TOKEN'])).
Control: GitHub run all pull request workflows raised repository
forks with no access to secrets, see
https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/

Threat 2: Someone could submit a pull request that alters the
publish.yml workflow so that it publishes on the pull_request event
instead of the release created event.
Control: same as for Threat 1.
@isidore isidore merged commit f730fe0 into approvals:master Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants