Skip to content

Delete .gitignore

Delete .gitignore #22

Workflow file for this run

name: Initial Setup
on:
push:
jobs:
initial_setup:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure single commit in repository
run: |
# Count the total number of commits
COMMIT_COUNT=$(git rev-list --count HEAD)
# Stop the workflow if the commit count is greater than 1
if [ "$COMMIT_COUNT" -gt 2 ]; then
echo "The repository has more than 2 commit ($COMMIT_COUNT commits). Stopping workflow."
exit 1
else
echo "The repository has $COMMIT_COUNT commit(s). Proceeding with the workflow."
fi
- name: Rename Container Name
run: |
# Extract the repository name from GITHUB_REPOSITORY
REPO_NAME=$(echo "${GITHUB_REPOSITORY##*/}")
# Replace {REPO_NAME} in docker-compose.yml
sed -i "s/{REPO_NAME}/${REPO_NAME}/g" .devcontainer/docker-compose.yml
- name: Remove initial setup workflow
run: rm -rf .github
continue-on-error: true
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add -A
git commit -m "Rename .devcontainer/docker and remove first-run workflow after initialization"
git push