Skip to content

Commit 665f54a

Browse files
committed
Update actions and improve security
1 parent 3f886fd commit 665f54a

2 files changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,30 @@ on:
66
tags:
77
- 'v**'
88

9+
permissions: {}
10+
911
jobs:
1012
build:
13+
permissions:
14+
contents: read
15+
1116
if: github.repository == 'ckan/ckanext-geoview'
1217
name: Build distribution
1318
runs-on: ubuntu-latest
1419
steps:
15-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
21+
with:
22+
persist-credentials: false
1623
- name: Set up Python
17-
uses: actions/setup-python@v5
24+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1825
with:
1926
python-version: "3.10"
2027
- name: Install pypa/build
2128
run: python3 -m pip install build --user
2229
- name: Build a binary wheel and a source tarball
2330
run: python3 -m build
2431
- name: Store the distribution packages
25-
uses: actions/upload-artifact@v4
32+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2633
with:
2734
name: python-package-distributions
2835
path: dist/
@@ -39,12 +46,12 @@ jobs:
3946
id-token: write
4047
steps:
4148
- name: Download all the dists
42-
uses: actions/download-artifact@v4
49+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
4350
with:
4451
name: python-package-distributions
4552
path: dist/
4653
- name: Publish distribution to PyPI
47-
uses: pypa/gh-action-pypi-publish@release/v1
54+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
4855

4956
publishSkipped:
5057
if: github.repository != 'ckan/ckanext-geoview'

.github/workflows/test.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
name: Tests
22
on: [push, pull_request]
3+
4+
permissions: {}
5+
36
jobs:
47
lint:
58
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
611
steps:
7-
- uses: actions/checkout@v4
8-
- uses: actions/setup-python@v5
12+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
13+
with:
14+
persist-credentials: false
15+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
916
with:
1017
python-version: '3.10'
1118
- name: Install requirements
@@ -25,7 +32,8 @@ jobs:
2532
- ckan-version: "2.10"
2633
ckan-image: "ckan/ckan-dev:2.10-py3.10"
2734
fail-fast: false
28-
35+
permissions:
36+
contents: read
2937
name: CKAN ${{ matrix.ckan-version }}
3038
runs-on: ubuntu-latest
3139
container:
@@ -51,7 +59,9 @@ jobs:
5159
CKAN_REDIS_URL: redis://redis:6379/1
5260

5361
steps:
54-
- uses: actions/checkout@v4
62+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
63+
with:
64+
persist-credentials: false
5565
- name: Install requirements
5666
run: |
5767
pip install -e .

0 commit comments

Comments
 (0)