mirror of
https://github.com/crate-ci/typos.git
synced 2026-10-17 01:25:12 +02:00
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
name: Template Update
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '1 1 1 * *'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
RUST_BACKTRACE: 1
|
|
CARGO_TERM_COLOR: always
|
|
CLICOLOR: 1
|
|
TEMPLATE_URL: "https://github.com/epage/_rust.git"
|
|
TEMPLATE_BRANCH: "main"
|
|
|
|
concurrency:
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
update:
|
|
permissions:
|
|
security-events: write # to create PR
|
|
pull-requests: write
|
|
contents: write # to push the branch
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: true # to push the branch and create PR
|
|
- name: Configure git
|
|
run: |
|
|
git config --global user.name '${GITHUB_ACTOR}'
|
|
git config --global user.email '<>'
|
|
- name: Fetch template
|
|
run: "git remote add template ${{ env.TEMPLATE_URL }} && git fetch template ${{ env.TEMPLATE_BRANCH }}"
|
|
- name: Merge template
|
|
run: "git checkout -b template-update && git merge template/${{ env.TEMPLATE_BRANCH }} -m 'chore: Update from template'"
|
|
- name: Clear any existing branch
|
|
run: "git push origin --delete template-update"
|
|
continue-on-error: true
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
- name: Push branch
|
|
run: "git push --set-upstream origin template-update"
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
- name: Create PR
|
|
run: "gh pr create --head template-update --title 'chore: Update from template' --body ''"
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
- name: Merge PR
|
|
run: "gh pr merge --auto --delete-branch"
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|