ci: exclude some workflows from forks/branches & better scope permissions (#57)
This commit is contained in:
parent
96e861b5ab
commit
32c742bfce
3 changed files with 16 additions and 10 deletions
6
.github/workflows/format.yml
vendored
6
.github/workflows/format.yml
vendored
|
@ -1,12 +1,14 @@
|
||||||
name: Format
|
name: Format
|
||||||
|
|
||||||
on:
|
on:
|
||||||
- push
|
push:
|
||||||
- pull_request
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
format-check:
|
format-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v20
|
- uses: cachix/install-nix-action@v20
|
||||||
|
|
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
|
@ -4,13 +4,14 @@ on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-please:
|
release-please:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: google-github-actions/release-please-action@v3
|
- uses: google-github-actions/release-please-action@v3
|
||||||
with:
|
with:
|
||||||
|
|
11
.github/workflows/update-docs.yml
vendored
11
.github/workflows/update-docs.yml
vendored
|
@ -5,20 +5,23 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- "modules/home-manager/**"
|
- "modules/home-manager/**"
|
||||||
- "modules/nixos/**"
|
- "modules/nixos/**"
|
||||||
|
workflow_dispatch:
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-docs:
|
update-docs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 1
|
max-parallel: 1
|
||||||
matrix:
|
matrix:
|
||||||
package: ["nixos", "home-manager"]
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: cachix/install-nix-action@v22
|
- uses: cachix/install-nix-action@v22
|
||||||
|
|
Loading…
Reference in a new issue