Skip to content

Commit ca0a429

Browse files
committed
CI job to create cargo-generate template branch
- Last part of job "Commit and Push" provided by Gemni 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 ca0a429

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/cargo-gen.yml

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

0 commit comments

Comments
 (0)