Skip to content

Repo

Repo #2

Workflow file for this run

# This file is @generated by <https://github.com/liblaf/copier-shared>.
# DO NOT EDIT!
name: Repo
on:
push:
branches:
- main
paths:
- .github/workflows/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:
- id: auth
name: Auth App
uses: liblaf/actions/auth-app@main
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.auth.outputs.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"
commit_user_name: ${{ steps.auth.outputs.committer-name }}
commit_user_email: ${{ steps.auth.outputs.committer-email }}
commit_author: ${{ steps.auth.outputs.author }}
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.GH_PAT || github.token }}
config-file: https://github.com/liblaf/.github/raw/refs/heads/main/.github/labels.yaml
delete-other-labels: false
repo-edit:
name: Edit Repository Setttings
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-repo-edit
cancel-in-progress: true
steps:
- name: Edit Repository Setttings
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.GH_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.GH_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.GH_PAT || github.token }}