From 82c615d66f9928e88ea5f1bb6b7f3b289e20cc92 Mon Sep 17 00:00:00 2001 From: brrock Date: Wed, 4 Dec 2024 07:08:34 +0000 Subject: [PATCH 1/2] finsihed --- .github/workflows/ghpr.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ghpr.yaml b/.github/workflows/ghpr.yaml index 0403b69..9ab0332 100644 --- a/.github/workflows/ghpr.yaml +++ b/.github/workflows/ghpr.yaml @@ -90,11 +90,4 @@ jobs: Please review the changes carefully before merging." else echo "PR already exists with number #$existing_pr" - fi - - - name: Cleanup - if: always() - run: | - BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) - git checkout main - git branch -D $BRANCH_NAME || true + fi \ No newline at end of file From cddabc0b7974a6727d4a23c7665c3163001a9739 Mon Sep 17 00:00:00 2001 From: brrock Date: Wed, 4 Dec 2024 19:49:59 +0000 Subject: [PATCH 2/2] chore: update gitignore for workflow files --- .github/workflows/bosh.yaml | 50 -------------------- .github/workflows/ghpr.yaml | 93 ------------------------------------- .gitignore | 3 +- 3 files changed, 2 insertions(+), 144 deletions(-) delete mode 100644 .github/workflows/bosh.yaml delete mode 100644 .github/workflows/ghpr.yaml diff --git a/.github/workflows/bosh.yaml b/.github/workflows/bosh.yaml deleted file mode 100644 index f7dfdb0..0000000 --- a/.github/workflows/bosh.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: Test and Notify Pipeline - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test-and-notify: - runs-on: ubuntu-latest - - steps: - # Checkout with deploy key for the main repo - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: latest - - - name: Install Bun - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - - name: Install Dependencies - run: pnpm install - - - name: Run Tests - id: tests - run: | - echo "Running tests..." - - continue-on-error: true - - - name: Handle Notification - run: | - cd /tmp - git clone http://192.168.0.35:3000/brrock/gitemailthinggamex.git - cd gitemailthinggamex - bun install - - if [ "${{ steps.tests.outcome }}" = "failure" ]; then - bun run sendfailed - else - bun run sendsuccess - fi diff --git a/.github/workflows/ghpr.yaml b/.github/workflows/ghpr.yaml deleted file mode 100644 index 9ab0332..0000000 --- a/.github/workflows/ghpr.yaml +++ /dev/null @@ -1,93 +0,0 @@ -name: Create GitHub PR from Gitea - -on: - workflow_dispatch: # Manual trigger - paths-ignore: - - '.github/workflows/**' # Avoid recursive triggers - issue_comment: - types: [created] - -jobs: - gh_pr: - runs-on: ubuntu-latest - if: ${{ github.event.comment.body == '!actions run pr' || github.event.pusher != '' || github.event.workflow_dispatch }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Full history for better sync - - - name: Install GitHub CLI - run: | - curl -sS https://webi.sh/gh | sh - source ~/.config/envman/PATH.env - gh auth login --with-token <<< "${{ secrets.GH_TOKEN }}" && gh auth status && echo done - - - name: Configure git - run: | - git config --global user.name "brrock" - git config --global user.email "brduck@duck.com" - - # Setup .gitignore for workflow files - if [ ! -f .gitignore ]; then - touch .gitignore - fi - - # Ensure workflow files are ignored - grep -qxF '.github/workflows/ghpr.yaml' .gitignore || echo '.github/workflows/ghpr.yaml' >> .gitignore - grep -qxF '.github/workflows/bosh.yaml' .gitignore || echo '.github/workflows/bosh.yaml' >> .gitignore - - - name: Add GitHub remote and push - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: | - # Clean up workflow files from git - git rm --cached .github/workflows/ghpr.yaml 2>/dev/null || true - git rm --cached .github/workflows/bosh.yaml 2>/dev/null || true - - # Add GitHub remote using token for authentication - git remote add github https://${GH_TOKEN}@github.com/brrock/gamex.git - - # Create and checkout canary branch - BRANCH_NAME=canary - git checkout -b $BRANCH_NAME - - # Stage and commit gitignore changes - git add .gitignore - git commit -m "chore: update gitignore for workflow files" || true - - # Push to GitHub - git push github $BRANCH_NAME --force - - - name: Create Pull Request - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: | - BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) - source ~/.config/envman/PATH.env - # Check if PR already exists - existing_pr=$(gh pr list \ - --repo brrock/gamex \ - --head $BRANCH_NAME \ - --json number \ - --jq '.[0].number') - - if [ -z "$existing_pr" ]; then - # Create new PR - gh pr create \ - --repo brrock/gamex \ - --base main \ - --head $BRANCH_NAME \ - --title "feat: sync changes from Gitea ($(date +%Y-%m-%d))" \ - --body "## Automated Sync from Gitea - - This PR contains the latest changes synchronized from the Gitea repository. - - ### Changes included: - $(git log --pretty=format:'- %s' main..$BRANCH_NAME) - - Please review the changes carefully before merging." - else - echo "PR already exists with number #$existing_pr" - fi \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7f5ed77..db5e525 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ prisma/migrations **/**/app/test .turbo packages/ui/dist -packages/**/dist \ No newline at end of file +packages/**/dist.github/workflows/ghpr.yaml +.github/workflows/bosh.yaml