Docker #756
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: Docker | |
on: | |
schedule: | |
- cron: "45 3 * * *" | |
push: | |
branches: [ master ] | |
jobs: | |
synctags: | |
name: Sync Tags | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.PA_TOKEN }} | |
fetch-depth: 0 | |
- name: Sync Tags | |
run: | | |
git remote add fork https://x-access-token:${PA_TOKEN}@github.com/flutter/gallery.git | |
for TAG in $(comm -23 <(git ls-remote --tags fork | grep -v '\^{}' | grep -v '-' | awk '{print $2}') <(git ls-remote --tags origin | grep -v '\^{}' | awk '{print $2}')); do | |
git fetch fork $TAG:$TAG --no-tags | |
TAG=$(echo $TAG | sed 's/refs\/tags\///') | |
MERGE_COMMIT=$(git log master $TAG..master --ancestry-path --merges --oneline | tail -n1 | awk '{print $1;}') | |
echo $TAG:$COMMIT | |
git tag -d $TAG | |
git tag $TAG $MERGE_COMMIT | |
git push origin --tags | |
done | |