First checkout repo
This commit is contained in:
parent
dc4684a8e1
commit
558bb73c4f
1 changed files with 14 additions and 9 deletions
|
@ -12,26 +12,29 @@ jobs:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
env:
|
env:
|
||||||
upstream: https://git.joeyh.name/git/git-annex.git
|
upstream: https://git.joeyh.name/git/git-annex.git
|
||||||
destination: ${{ github.server_url }}/${{ github.repository }}
|
|
||||||
tags: '10.2024*'
|
tags: '10.2024*'
|
||||||
token: ${{ secrets.CODE_FORGEJO_TOKEN }}
|
|
||||||
owner: ${{ vars.OWNER }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Environment setup
|
- name: Environment setup
|
||||||
run: apk add grep git sed coreutils bash
|
run: apk add grep git sed coreutils bash nodejs
|
||||||
|
- name: Fetch destination
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch_depth: 1
|
||||||
|
ref: ci
|
||||||
|
token: ${{ secrets.CODE_FORGEJO_TOKEN }}
|
||||||
- name: Missing tag detecting
|
- name: Missing tag detecting
|
||||||
run: |
|
run: |
|
||||||
git ls-remote $upstream "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > upstream_tags
|
git ls-remote $upstream "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > upstream_tags
|
||||||
git ls-remote $destination "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > destination_tags
|
git ls-remote ${{ github.server_url}}/${{ github.repository }} "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > destination_tags
|
||||||
cat upstream_tags destination_tags | tr ' ' '\n' | sort | uniq -u > missing_tags
|
cat upstream_tags destination_tags | tr ' ' '\n' | sort | uniq -u > missing_tags
|
||||||
echo "Missing tags:"
|
echo "Missing tags:"
|
||||||
cat missing_tags
|
cat missing_tags
|
||||||
- name: Missing tag fetch
|
- name: Missing tag fetch
|
||||||
run: |
|
run: |
|
||||||
git init .
|
git init .
|
||||||
git remote add origin $upstream
|
git remote add upstream $upstream
|
||||||
while read tag; do
|
while read tag; do
|
||||||
git fetch origin tag $tag --no-tags
|
git fetch upstream tag $tag --no-tags
|
||||||
done < missing_tags
|
done < missing_tags
|
||||||
- name: Packaging workflow injection
|
- name: Packaging workflow injection
|
||||||
run: |
|
run: |
|
||||||
|
@ -39,8 +42,10 @@ jobs:
|
||||||
git checkout $tag
|
git checkout $tag
|
||||||
git tag -d $tag
|
git tag -d $tag
|
||||||
git checkout ci -- ./forgejo
|
git checkout ci -- ./forgejo
|
||||||
|
git config user.name "forgejo-actions[bot]"
|
||||||
|
git config user.email "dev@ayakael.net"
|
||||||
git commit -m 'Inject custom workflow'
|
git commit -m 'Inject custom workflow'
|
||||||
git tag -a $tag -m $tag
|
git tag -a $tag -m $tag
|
||||||
done < missing_tags
|
done < missing_tags
|
||||||
- name: Pushing patched tags
|
- name: Push to destination
|
||||||
run: git push --force https://any:$token@$destination refs/tags/*:refs/tags/* --tags
|
run: git push --force origin refs/tags/*:refs/tags/* --tags
|
||||||
|
|
Loading…
Reference in a new issue