Use granular permissions for GitHub Actions

This commit is contained in:
Tyrrrz
2023-05-27 22:42:04 +03:00
parent 03784f0d7c
commit 2b7f1ed4ed
2 changed files with 21 additions and 4 deletions

View File

@@ -5,6 +5,9 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Checkout
@@ -30,6 +33,8 @@ jobs:
deploy-latest:
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
@@ -55,6 +60,8 @@ jobs:
deploy-stable:
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
@@ -80,4 +87,4 @@ jobs:
--push
--tag tyrrrz/discordchatexporter:stable
--tag tyrrrz/discordchatexporter:${{ steps.get-version.outputs.tag }}
.
.