aormsby / Fork-Sync-With-Upstream-action

An action to automatically update your fork with new commits from the upstream repo
MIT License
258 stars 70 forks source link

Output variable request: Check if a tag is created upstream and run workflow only based on that #71

Closed arunsathiya closed 8 months ago

arunsathiya commented 1 year ago

It'd be nice to be able to check if a tag is created upstream, and run the sync action only when it is created. The GitHub workflows syntax seem to allow checking of tags only in the current repository, not upstream, so that might need to be handled with an action.

Thus the feature request here.

aormsby commented 8 months ago

Yeah, I think if you're trying to use a tag's creation on the remote branch as a workflow trigger, that doesn't sound feasible. You could try something like this in your workflow steps to run when a given tag is present (but I don't think it's what you're looking for). I don't think I can help much beyond that since I can't control workflow triggers.

      - name: List tags
        id: list_tags
        run: |
          git ls-remote --tags {remote_repo_url}
          git tag -l > tags.txt

      - name: Sync upstream changes
        id: sync
        if: contains(steps.list_tags.outputs.stdout, 'specific-tag').   # runs conditionally if tag is found
        uses: aormsby/Fork-Sync-With-Upstream-action@v3.4
          with: # etc.