Skip to content

Commit

Permalink
chore: Update PyPi to use trusted publisher for authentication and co…
Browse files Browse the repository at this point in the history
…rrectly escape change log body. (#759)

* fix: Escape release tag body and change PyPi to use trusted publisher for authentication.

* fix typo
  • Loading branch information
jonathanedey committed Feb 13, 2024
1 parent 821b495 commit 2ec1267
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/publish_preflight_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ echo "$CHANGELOG"
# and https://github.com/github/docs/issues/21529#issue-1418590935
FILTERED_CHANGELOG=`echo "$CHANGELOG" | grep -v "\\[INFO\\]"`
echo "changelog<<CHANGELOGEOF" >> $GITHUB_OUTPUT
echo "$FILTERED_CHANGELOG" >> $GITHUB_OUTPUT
echo -e "$FILTERED_CHANGELOG" >> $GITHUB_OUTPUT
echo "CHANGELOGEOF" >> $GITHUB_OUTPUT


Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ jobs:
startsWith(github.event.pull_request.title, '[chore] Release ')

runs-on: ubuntu-latest
permissions:
# Used to create a short-lived OIDC token which is given to PyPi to identify this workflow job
# See: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings
# and https://docs.pypi.org/trusted-publishers/using-a-publisher/
id-token: write

steps:
- name: Checkout source for publish
Expand All @@ -116,10 +121,7 @@ jobs:
--notes "${{ steps.preflight.outputs.changelog }}"

- name: Publish to Pypi
uses: pypa/gh-action-pypi-publish@v1.0.0a0
with:
user: firebase
password: ${{ secrets.PYPI_PASSWORD }}
uses: pypa/gh-action-pypi-publish@release/v1

# Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
- name: Post to Twitter
Expand Down

0 comments on commit 2ec1267

Please sign in to comment.