-
Notifications
You must be signed in to change notification settings - Fork 2
106 lines (99 loc) · 3.04 KB
/
shared-repo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This file is @generated by <https://github.com/liblaf/copier-shared>.
# DO NOT EDIT!
name: (Shared) Repo
on:
push:
branches:
- main
paths:
- .github/workflows/auto-repo.yaml
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
copier-update:
name: Copier Update
permissions:
actions: write
contents: write
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-copier-update
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT || github.token }}
- name: Copier Update
uses: liblaf/actions/copier-update@main
- name: Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(copier): update from template"
label-sync:
name: Label Sync
permissions:
issues: write
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-label-sync
cancel-in-progress: true
steps:
- name: Label Sync
uses: EndBug/label-sync@v2
with:
token: ${{ secrets.PAT || github.token }}
config-file: https://github.com/liblaf/.github/raw/refs/heads/main/.github/labels.yaml
delete-other-labels: false
repo-edit:
name: Repo Edit
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-repo-edit
cancel-in-progress: true
steps:
- name: Repo Edit
run: |-
gh repo edit ${{ github.repository }} \
--allow-update-branch \
--default-branch "main" \
--delete-branch-on-merge \
--enable-auto-merge \
--enable-discussions \
--enable-issues \
--enable-merge-commit=false \
--enable-rebase-merge=false \
--enable-squash-merge \
--enable-wiki=false
env:
GH_TOKEN: ${{ secrets.PAT || github.token }}
ruleset-import:
name: Ruleset Import
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-ruleset-import
cancel-in-progress: true
steps:
- name: Ruleset Import
uses: liblaf/actions/ruleset-import@main
with:
token: ${{ secrets.PAT || github.token }}
source-repo: liblaf/.github
source-ruleset-id: 3407904
set-default-workflow-permissions:
name: Set Default Workflow Permissions
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-set-default-workflow-permissions
cancel-in-progress: true
steps:
- name: Set Default Workflow Permissions
run: |-
# https://docs.github.com/en/rest/actions/permissions#set-default-workflow-permissions-for-a-repository
gh api /repos/${{ github.repository }}/actions/permissions/workflow \
--field default_workflow_permissions="read" \
--field can_approve_pull_request_reviews=true \
--method PUT
env:
GH_TOKEN: ${{ secrets.PAT || github.token }}