ci: allow manual pull of tag or commit

This commit is contained in:
Antoine Martin 2025-03-22 16:23:25 -04:00
parent 063442dac9
commit 3c9ca40325
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -1,5 +1,10 @@
on:
workflow_dispatch:
inputs:
ref_name:
description: 'Tag or commit'
required: false
type: string
schedule:
- cron: '@hourly'
@ -24,9 +29,13 @@ jobs:
token: ${{ secrets.CODE_FORGEJO_TOKEN }}
- name: Missing tag detecting
run: |
git ls-remote $upstream "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > upstream_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
if [ -n "${{ inputs.ref_name }}" ]; then
echo ${{ inputs.ref_name }} > missing_tags
else
git ls-remote $upstream "refs/tags/$tags" | grep -v '{' | sed 's|.*/||' > upstream_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
fi
echo "Missing tags:"
cat missing_tags
- name: Missing tag fetch