From 3c9ca4032526baa579d80372be818fe03899211a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 22 Mar 2025 16:23:25 -0400 Subject: [PATCH] ci: allow manual pull of tag or commit --- .forgejo/workflows/mirror-repository.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/mirror-repository.yml b/.forgejo/workflows/mirror-repository.yml index e60fe6f5c3..6ffe52966f 100644 --- a/.forgejo/workflows/mirror-repository.yml +++ b/.forgejo/workflows/mirror-repository.yml @@ -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