Skip to content

Merge pull request #20 from talgat-abdraimov/chore/bumpver #22

Merge pull request #20 from talgat-abdraimov/chore/bumpver

Merge pull request #20 from talgat-abdraimov/chore/bumpver #22

Workflow file for this run

name: Repo Created
on:
push:
branches:
- main
permissions:
contents: write
jobs:
# This job checks if the repository is new runs only once and deletes itself
check-initial-commit:
if: ${{ !github.event.repository.is_template }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if initial commit
id: check
run: |
if [ $(git rev-list --count HEAD) -le 1 ]
then
echo "initial_commit=true" >> $GITHUB_OUTPUT
else
echo "initial_commit=false" >> $GITHUB_OUTPUT
fi
- name: Change README
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.check.outputs.initial_commit == 'true'
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
echo "# ${{github.event.repository.name}} project :wave:" > README.md
git add README.md
git commit -m "Changed README.md"
git push
- name: Remove current workflow
if: steps.check.outputs.initial_commit == 'true'
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git rm .github/workflows/update-readme.yml
git commit -m "Remove initial commit workflow"
git push