Skip to content

Commit

Permalink
Update GitHub Actions to use trusted publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfriedman6 committed Sep 27, 2024
1 parent e12e307 commit d50a280
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [ released ]

permissions:
id-token: write
contents: read

jobs:
check_production_tag:
name: Check if the release is tagged as production
Expand All @@ -26,10 +30,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand All @@ -52,6 +56,4 @@ jobs:
.
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
11 changes: 7 additions & 4 deletions .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [ released ]

permissions:
id-token: write
contents: read

jobs:
check_qa_tag:
name: Check if the release is tagged as QA
Expand All @@ -26,10 +30,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand All @@ -54,5 +58,4 @@ jobs:
- name: Publish distribution package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
10 changes: 5 additions & 5 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Run Python unit tests

on:
on:
pull_request:
actions: [ opened ]
types: [ labeled, unlabeled, opened, reopened, synchronize ]

jobs:
changelog:
name: Updates changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dangoslen/changelog-enforcer@v3
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand Down

0 comments on commit d50a280

Please sign in to comment.