diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml new file mode 100644 index 0000000..3e938d0 --- /dev/null +++ b/.gitea/workflows/main.yml @@ -0,0 +1,26 @@ +# I Am A Strange Loop +name: Mirror to GitHub +run-name: Mirror to GitHub +on: [push] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + # If I were going to make this as a template, I'd instead use the `${{ github.[...] }} context to determin owner + # and name directly from the context. + # I'm leaving that off because it'd require a whole other step (to pipe `github.repository` through a splitting + # tool, because there's only `github.repository_owner`, no `github.repository_name`) + # + # (And the token should be retrieved from Vault) + # Using `github.ref` just in case there's any race condition ambiguity. + - uses: https://gitea.scubbo.org/scubbo/commit-report-sync@${{ github.ref}} + with: + target_repo_domain: github.com + target_repo_owner: scubbo + target_repo_name: gitea-commit-mirror + source_repo_domain: gitea.scubbo.org + source_repo_owner: scubbo + source_repo_name: commit-report-sync + token_for_target_repo: ${{ secrets.PAT_FOR_GITHUB_SYNC }} + diff --git a/.gitignore b/.gitignore index 425a600..fe0bcbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ !node_modules/ !dist/ +!.gitea/ working/ diff --git a/dist/index.js b/dist/index.js index 2bd8186..fe7fae0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -25838,6 +25838,8 @@ async function main(sourceRepo, targetRepo, dryRun, tokenForTargetRepo) { else { console.log(`DEBUG - could not find a targetCommit that is earlier than or equal to the sourceCommit ${sourceCommit.hash} - therefore, writing the source commit's representation onto the current HEAD of target repo`); insertRepresentativeCommit(sourceRepo, sourceCommit, undefined, undefined); + // As above, have to regenerate history after mutation + targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, sourceCommit.date); } } // OK, that's it - we've processed all the source commits, and we've inserted all the necessary target commits. diff --git a/node_modules/@vercel/ncc/dist/ncc/cli.js.cache b/node_modules/@vercel/ncc/dist/ncc/cli.js.cache index 88e89c1..97f8dfd 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/cli.js.cache and b/node_modules/@vercel/ncc/dist/ncc/cli.js.cache differ diff --git a/node_modules/@vercel/ncc/dist/ncc/index.js.cache b/node_modules/@vercel/ncc/dist/ncc/index.js.cache index b1dd2b6..1270c3b 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/index.js.cache and b/node_modules/@vercel/ncc/dist/ncc/index.js.cache differ diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache index 6cedc94..a5cbf19 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache differ diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache index a21db8b..692ae5e 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache differ diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache index c964c4f..32e33f9 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/ts-loader.js.cache differ diff --git a/src/main.ts b/src/main.ts index 5c88f09..b2aaa27 100644 --- a/src/main.ts +++ b/src/main.ts @@ -110,8 +110,9 @@ export async function main(sourceRepo: Repo, targetRepo: Repo, dryRun: boolean, } else { console.log(`DEBUG - could not find a targetCommit that is earlier than or equal to the sourceCommit ${sourceCommit.hash} - therefore, writing the source commit's representation onto the current HEAD of target repo`); insertRepresentativeCommit(sourceRepo, sourceCommit, undefined, undefined); + // As above, have to regenerate history after mutation + targetCommitHistory = buildTargetCommitHistory(TARGET_DIR, sourceCommit.date); } - } // OK, that's it - we've processed all the source commits, and we've inserted all the necessary target commits. // We can just `git push` to the target repo now.