Skip to content

Commit

Permalink
Merge pull request #16 from talgat-abdraimov/feature/initial-commit-w…
Browse files Browse the repository at this point in the history
…orkflow

add step that deletes initial-commit workflow after exec
  • Loading branch information
talgat-abdraimov authored Apr 17, 2024
2 parents 83908af + bf6fc64 commit 740b028
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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
Expand All @@ -18,7 +19,7 @@ jobs:
with:
fetch-depth: 0

- name: check if initial commit
- name: Check if initial commit
id: check
run: |
if [ $(git rev-list --count HEAD) -le 1 ]
Expand All @@ -39,3 +40,12 @@ jobs:
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

0 comments on commit 740b028

Please sign in to comment.