Skip to content

Commit a696195

Browse files
committed
ci: explicit permissions on actions
1 parent 0addf2e commit a696195

8 files changed

+37
-13
lines changed

.github/workflows/cli.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: ["master"]
88

9+
permissions:
10+
contents: read
11+
912
env:
1013
CARGO_TERM_COLOR: always
1114

.github/workflows/manual-release-brew-and-scoop.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
description: "Tag to release (e.g. v1.2.3)"
88
required: true
99

10+
permissions:
11+
contents: write
12+
1013
jobs:
1114
call-release-homebrew-tap:
1215
uses: ./.github/workflows/release-homebrew-tap.yaml

.github/workflows/pgTAP.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
pull_request:
44
branches: [ master ]
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
build:
811
runs-on: ubuntu-latest

.github/workflows/pre-commit_hooks.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: pre-commit hooks
22

33
on: [push]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
runs-on: ubuntu-latest

.github/workflows/prettier.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- 'master'
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
check-prettier:
1013
runs-on: ubuntu-latest

.github/workflows/release-cli.yaml

+12-9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
contents: write
10+
811
jobs:
912
create-release:
1013
name: Create Release
@@ -73,25 +76,25 @@ jobs:
7376
cd ../..
7477
7578
# Build debian package
76-
package_dir=dbdev-${{ github.ref_name }}-linux-${{ matrix.box.arch }}
77-
mkdir -p ${package_dir}/usr/local/bin
78-
cp ./target/release/dbdev ${package_dir}/usr/local/bin/dbdev
79+
package_dir="dbdev-${{ github.ref_name }}-linux-${{ matrix.box.arch }}"
80+
mkdir -p "${package_dir}/usr/local/bin"
81+
cp ./target/release/dbdev "${package_dir}/usr/local/bin/dbdev"
7982
80-
extension_version=${{ github.ref_name }}
83+
extension_version="${{ github.ref_name }}"
8184
# strip the leading v
82-
deb_version=${extension_version:1}
85+
deb_version="${extension_version:1}"
8386
84-
mkdir -p ${package_dir}/DEBIAN
85-
touch ${package_dir}/DEBIAN/control
87+
mkdir -p "${package_dir}/DEBIAN"
88+
touch "${package_dir}/DEBIAN/control"
8689
echo 'Package: dbdev' >> ${package_dir}/DEBIAN/control
8790
echo 'Version:' ${deb_version} >> ${package_dir}/DEBIAN/control
8891
echo 'Architecture: ${{ matrix.box.arch }}' >> ${package_dir}/DEBIAN/control
8992
echo 'Maintainer: supabase' >> ${package_dir}/DEBIAN/control
9093
echo 'Description: CLI for publishing to database.dev' >> ${package_dir}/DEBIAN/control
9194
9295
# Create deb package
93-
sudo chmod -R 00755 ${package_dir}
94-
sudo dpkg-deb --build ${package_dir}
96+
sudo chmod -R 00755 "${package_dir}"
97+
sudo dpkg-deb --build "${package_dir}"
9598
9699
- name: Upload gzip Package
97100
uses: actions/upload-release-asset@v1

.github/workflows/release-homebrew-tap.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
homebrew_tap_rw:
1111
required: true
1212

13+
permissions:
14+
contents: write
15+
1316
jobs:
1417
release:
1518
runs-on: ubuntu-latest
@@ -46,9 +49,9 @@ jobs:
4649
linux_arm64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-linux-arm64.tar.gz | cut -d" " -f1`
4750
macos_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-macos-amd64.tar.gz | cut -d" " -f1`
4851
49-
tag=${{ inputs.tag }}
52+
tag="${{ inputs.tag }}"
5053
# strip the leading v
51-
version=${tag:1}
54+
version="${tag:1}"
5255
5356
# update dbdev.rb file
5457
echo '# typed: false' > dbdev.rb

.github/workflows/release-scoop-bucket.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
scoop_bucket_rw:
1111
required: true
1212

13+
permissions:
14+
contents: write
15+
1316
jobs:
1417
release:
1518
runs-on: ubuntu-latest
@@ -31,9 +34,9 @@ jobs:
3134
run: |
3235
windows_amd64_hash=`shasum -a 256 dbdev-${{ inputs.tag }}-windows-amd64.zip | cut -d" " -f1`
3336
34-
tag=${{ inputs.tag }}
37+
tag="${{ inputs.tag }}"
3538
# strip the leading v
36-
version=${tag:1}
39+
version="${tag:1}"
3740
3841
# update dbdev.json file
3942
echo '{' > dbdev.json

0 commit comments

Comments
 (0)