Skip to content

Commit f0ef0df

Browse files
authored
build: pin actions to long commit hashes and fix deploy-test for trusted publishing (#303)
* switch to trusted publishing * pin actions to long hashes with pinact
1 parent 4516e46 commit f0ef0df

9 files changed

Lines changed: 48 additions & 32 deletions

.github/workflows/api-docs.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v6
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020

2121
- name: Setup python
22-
uses: actions/setup-python@v6
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2323
with:
2424
python-version: 3.x
2525

2626
- name: Setup cache
27-
uses: actions/cache@v5
27+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
2828
with:
2929
key: ${{ github.ref }}
3030
path: .cache
@@ -61,6 +61,6 @@ jobs:
6161
CATEGORY_ID: ${{env.CATEGORY_ID}}
6262

6363
- name: Run `docs` command 🚀
64-
uses: readmeio/rdme@v10
64+
uses: readmeio/rdme@3c41af599df44e516c90ba4107a81c05d4945822 # v10.6.2
6565
with:
6666
rdme: docs docs/_pydoc/temp --key=${{ secrets.README_API_KEY }} --version=1.0

.github/workflows/compliance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
name: Check license compliance
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v6
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020

2121
- name: Install uv
22-
uses: astral-sh/setup-uv@v7
22+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2323
with:
2424
enable-cache: true
2525
python-version: "3.10"

.github/workflows/continuous-deployment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: Tests
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
- name: Run integration tests
1919
uses: ./.github/actions/integration_tests
2020
with:

.github/workflows/continuous-deployment-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
environment: PROD
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v6
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
- name: Run integration tests
2020
uses: ./.github/actions/integration_tests
2121
with:

.github/workflows/continuous-integration.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
name: Format Code
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v6
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1616
- name: Install uv
17-
uses: astral-sh/setup-uv@v7
17+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
1818
with:
1919
enable-cache: true
2020
python-version: "3.10"
@@ -27,9 +27,9 @@ jobs:
2727
name: Lint Code
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v6
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3131
- name: Install uv
32-
uses: astral-sh/setup-uv@v7
32+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
3333
with:
3434
enable-cache: true
3535
python-version: "3.10"
@@ -42,9 +42,9 @@ jobs:
4242
name: Type checking with mypy
4343
runs-on: ubuntu-latest
4444
steps:
45-
- uses: actions/checkout@v6
45+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4646
- name: Install uv
47-
uses: astral-sh/setup-uv@v7
47+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
4848
with:
4949
enable-cache: true
5050
python-version: "3.10"
@@ -57,7 +57,7 @@ jobs:
5757
name: Scan for secrets
5858
runs-on: ubuntu-latest
5959
steps:
60-
- uses: actions/checkout@v6
60+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6161
with:
6262
fetch-depth: 0
6363
- name: Install gitleaks
@@ -73,12 +73,12 @@ jobs:
7373
env:
7474
API_KEY: "not-a-real-api-key"
7575
steps:
76-
- uses: actions/checkout@v6
76+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7777
with:
7878
# for coverage comment action
7979
fetch-depth: 1000
8080
- name: Install uv
81-
uses: astral-sh/setup-uv@v7
81+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
8282
with:
8383
enable-cache: true
8484
python-version: "3.10"

.github/workflows/deploy-prod.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
env:
1717
pypi: ${{ vars.PYPI_URL }}
1818
steps:
19-
- uses: actions/checkout@v6
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020
- name: Install uv
21-
uses: astral-sh/setup-uv@v7
21+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2222
with:
2323
enable-cache: true
2424
python-version: "3.10"
@@ -28,6 +28,6 @@ jobs:
2828
- name: Build
2929
run: make build
3030
- name: publish
31-
uses: pypa/gh-action-pypi-publish@release/v1
31+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
3232
with:
3333
repository-url: ${{env.pypi}}

.github/workflows/deploy-test.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,27 @@ on:
66
- labeled
77
workflow_dispatch:
88

9+
permissions:
10+
id-token: write
11+
912
jobs:
1013
deploy-test:
11-
if: ${{ github.event.label.name == 'test-deploy' }} || github.event.label.name !='integration'`
12-
uses: ./.github/workflows/deploy.yml
13-
with:
14-
deployment_env: test
15-
api_url: "https://api.dev.cloud.dpst.dev/api/v1"
16-
secrets: inherit
14+
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.label.name == 'test-deploy') }}
15+
runs-on: ubuntu-latest
16+
environment: test
17+
env:
18+
pypi: ${{ vars.PYPI_URL }}
19+
20+
steps:
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
24+
with:
25+
enable-cache: true
26+
python-version: "3.10"
27+
- name: Build
28+
run: make build
29+
- name: Publish
30+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
31+
with:
32+
repository-url: ${{ env.pypi }}

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
pypi: ${{ vars.PYPI_URL }}
2626

2727
steps:
28-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
- name: Install uv
30-
uses: astral-sh/setup-uv@v7
30+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
3131
with:
3232
enable-cache: true
3333
python-version: "3.10"
@@ -37,6 +37,6 @@ jobs:
3737
- name: Build
3838
run: make build
3939
- name: publish
40-
uses: pypa/gh-action-pypi-publish@release/v1
40+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
4141
with:
4242
repository-url: ${{env.pypi}}

.github/workflows/merge-queue.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
if: (github.event.action =='labeled' && github.event.label.name =='integration') || (github.event.action =='synchronize' && contains(github.event.pull_request.labels.*.name, 'integration')) || github.event.action =='workflow_call' || github.event_name == 'merge_group'
2727
steps:
28-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929
- name: Run integration tests
3030
uses: ./.github/actions/integration_tests
3131
with:
@@ -37,9 +37,9 @@ jobs:
3737
needs: [integration_tests]
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v6
40+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4141
- name: Install uv
42-
uses: astral-sh/setup-uv@v7
42+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
4343
with:
4444
enable-cache: true
4545
python-version: "3.10"

0 commit comments

Comments
 (0)