Skip to content

Commit 649d7f1

Browse files
committed
CI job to create cargo-generate template branch
- Last part of job "Commit and Push" provided by Gemini and edited by me. - Verified email address based on https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
1 parent c896c1e commit 649d7f1

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/cargo-gen.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Create Cargo Generate Template
2+
# Template is created on a new branch
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- create-cargo-generate-template # For testing
9+
10+
permissions:
11+
contents: write # for committing to cargo-gen branch.
12+
13+
jobs:
14+
create-cargo-generate-template:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4 # repo checkout
18+
- uses: actions-rs/toolchain@v1
19+
with:
20+
profile: minimal
21+
toolchain: nightly
22+
- name: Replace values with placeholders
23+
run: ./fill_template.rs
24+
- name: Commit and Push
25+
run: |
26+
# 1. Configure Git
27+
git config --global user.name "github-actions[bot]"
28+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
29+
30+
# 2. Create/Switch to the target branch
31+
git checkout -b cargo-gen
32+
33+
# 3. Add and commit
34+
git add .
35+
git commit -m "Replace values with template values"
36+
37+
# 4. Push to the remote
38+
git push origin cargo-gen --force

0 commit comments

Comments
 (0)