Use github-mirror-action@v3 #28
This file contains 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: 'mirror' | |
on: | |
push: | |
branches: | |
- __mirror | |
schedule: | |
# Run everyday at 3 AM UTC | |
- cron: '0 3 * * *' | |
workflow_dispatch: | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
name: mirror | |
steps: | |
- name: mirror | |
id: mirror | |
uses: bridgelightcloud/github-mirror-action@v3 | |
with: | |
origin: 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git' | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: check | |
run: | | |
REPO=$( basename $PWD ) | |
cd .. | |
mv $REPO ${REPO}.git | |
git clone --shared ${REPO}.git $REPO | |
cd $REPO | |
for branch in $( cat rc-branches ); do | |
git worktree add ../${branch} ${branch} | |
pushd ../${branch} | |
if git log --oneline | grep "Linux\ .*\-rc.*" >/dev/null; then | |
KERNEL_VERSION=$( git log --oneline | grep "Linux\ .*\-rc.*" ) | |
echo "build ${KERNEL_VERSION}" | |
else | |
echo "nobuild" | |
fi | |
popd | |
done | |
# - name: check_env | |
# run: | | |
# pwd | |
# ls -l | |
# git status || true | |
# git checkout linux-6.6.y || true | |
# if git log --oneline HEAD~1 | grep "Linux\ .*\-rc.*"; then | |
# echo "build" | |
# echo "call linux-6.6.y test-build workflow" | |
# else | |
# echo "nobuild" | |
# fi | |
# cd .. | |
# ls -l | |
# check_matrix: | |
# needs: mirror | |
# strategy: | |
# # Don't cancel the remaining running jobs if some job(s) fail(s) | |
# fail-fast: false | |
# matrix: | |
# branch: ['linux-6.6.y', 'linux-6.1.y' ] | |
# max-parallel: 1 | |
# steps: | |
# - name: check | |
# run: | | |
# pwd | |
# ls -l | |
# if [[ -e Makefile ]]; then | |
# make mrproper || true | |
# fi | |
# git checkout ${{ matrix.branch }} | |
# if git log --oneline | grep "Linux\ .*\-rc.*"; then | |
# echo "build for ${{ matrix.branch }}" | |
# else | |
# echo "nobuild for ${{ matrix.branch }}" | |
# fi | |
# ls -l | |
# cd .. | |
# ls -l | |
# exit 0 | |