Skip to content

Commit cd69a62

Browse files
committed
chore(ci): Test out template updater
1 parent 324ab81 commit cd69a62

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/template.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Template Update
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
schedule:
8+
- cron: '1 1 1 * *'
9+
workflow_dispatch:
10+
11+
env:
12+
RUST_BACKTRACE: 1
13+
CARGO_TERM_COLOR: always
14+
CLICOLOR: 1
15+
TEMPLATE_URL: "https://github.com/epage/_rust.git"
16+
TEMPLATE_BRANCH: "main"
17+
18+
concurrency:
19+
group: "${{ github.workflow }}-${{ github.ref }}"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
update:
24+
permissions:
25+
security-events: write # to create PR
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
- name: Configure git
33+
run: |
34+
git config --global user.name '${{ github.actor }}'
35+
git config --global user.email '<>'
36+
- name: Fetch template
37+
run: "git remote add template ${{ env.TEMPLATE_URL }} && git fetch template ${{ env.TEMPLATE_BRANCH }}"
38+
- name: Merge template
39+
run: "git checkout -b template-update && git merge template/${{ env.TEMPLATE_BRANCH }} -m 'chore: Update from template'"
40+
- name: Push branch
41+
run: "git push -f"
42+
env:
43+
GH_TOKEN: ${{ github.token }}
44+
- name: Create PR
45+
run: "gh pr create -H template-update -t 'chore: Update from template'"
46+
env:
47+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)