-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.27 KB
/
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
name: Setup
on:
push:
jobs:
setup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if repository is fresh
id: check_fresh
run: |
commit_count=$(git rev-list --count HEAD)
if [ "$commit_count" -eq 1 ]; then
echo "Repository has only one commit. Proceeding with setup."
echo "is_fresh=true" >> $GITHUB_OUTPUT
else
echo "Repository has more than one commit. Skipping setup."
echo "is_fresh=false" >> $GITHUB_OUTPUT
fi
- name: Install poetry
if: steps.check_fresh.outputs.is_fresh == 'true'
run: pipx install poetry
- name: Example setup step
if: steps.check_fresh.outputs.is_fresh == 'true'
run: |
make update
make poetry.lock Dockerfile
rm -rf .github/workflows/setup.yml
rm -rf .github/workflows/update.yml
rm -rf .github/workflows/duplicate.yml
- name: Commit changes
if: steps.check_fresh.outputs.is_fresh == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "new repo setup"