generated from bstollnitz/ml-template
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.29 KB
/
initial_setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This GitHub Action workflow runs when a new repository is created from this
# template repo.
name: Initial Setup
on:
push:
branches:
- main
env:
REPO_NAME: ${{ github.event.repository.name }}
jobs:
initial_setup:
runs-on: ubuntu-latest
if: ${{ github.event.created }}
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository
contents: write
steps:
# GitHub Action marketplace: https://github.com/marketplace/actions/checkout
- name: Checkout
uses: actions/checkout@v3
# GitHub Action marketplace: https://github.com/marketplace/actions/find-and-replace
- name: Replace token with repository name
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "<GITHUB_REPOSITORY>"
replace: ${{ env.REPO_NAME }}
exclude: "{.git,.github}/**"
- name: Rename source code directory to repository name
run: mv ml-template $REPO_NAME
# GitHub Action marketplace: https://github.com/marketplace/actions/git-auto-commit
- name: Commit all changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Initial repo setup
commit_options: "--no-verify --signoff"