Sync from Codeberg #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync from Codeberg | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| logLevel: | |
| description: 'Log level' | |
| required: true | |
| default: 'warning' | |
| schedule: | |
| - cron: '0 0 * * *' # Runs every day at midnight UTC | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| env: | |
| CBERG_HTTPS: https://codeberg.org/gongchandang49/bypass-all-shortlinks-debloated.git | |
| CBERG_BRANCH: main | |
| GH_BRANCH: main | |
| GIT_USER: "gongchandang49" | |
| GIT_EMAIL: "gongchandang49@noreply.codeberg.org" | |
| steps: | |
| - name: Checkout GitHub repository | |
| uses: actions/checkout@v6 | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name ${GIT_USER} | |
| git config --global user.email ${GIT_EMAIL} | |
| - name: Pull from Codeberg | |
| run: | | |
| git remote remove codeberg || true | |
| git remote add codeberg "${CBERG_HTTPS}" | |
| git fetch --prune codeberg "${CBERG_BRANCH}" | |
| git switch -C "${GH_BRANCH}" "codeberg/${CBERG_BRANCH}" | |
| git checkout -f "${GH_BRANCH}" | |
| - name: Push changes to GitHub | |
| run: | | |
| git push --force origin "${GH_BRANCH}" |