Skip to content

Commit

Permalink
ci: exclude some workflows from forks/branches & better scope permiss…
Browse files Browse the repository at this point in the history
…ions (#57)
  • Loading branch information
getchoo authored Nov 3, 2023
1 parent 96e861b commit 32c742b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Format

on:
- push
- pull_request
push:
branches: [main]
pull_request:

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v20
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- uses: google-github-actions/release-please-action@v3
with:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ on:
paths:
- "modules/home-manager/**"
- "modules/nixos/**"

permissions:
contents: write

workflow_dispatch:

jobs:
update-docs:
runs-on: ubuntu-latest

permissions:
contents: write

strategy:
max-parallel: 1
matrix:
package: ["nixos", "home-manager"]

# we only want this running on our repo, on the `main` branch
if: github.repository == 'Stonks3141/ctp-nix' && github.ref_name == 'main'

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v22
Expand Down

0 comments on commit 32c742b

Please sign in to comment.