Skip to content

feat: Tag pruner action (SOFIE-1140) - #1

Merged
PeterC89 merged 3 commits into
mainfrom
feat/sofie-tag-pruner
Feb 27, 2023
Merged

feat: Tag pruner action (SOFIE-1140)#1
PeterC89 merged 3 commits into
mainfrom
feat/sofie-tag-pruner

Conversation

@PeterC89

Copy link
Copy Markdown
Contributor

Jira: https://nrknyemedier.atlassian.net/browse/SOFIE-1140

Create a generic action that can be used to prune tags from GitHub repositories based on age with an optional Regex filter.

Once merged the repo will need tagging with a suitable tag E.G. v1 or tag-pruner-v1 so that the action can be called in other repos: nrkno/sofie-github-workflows/.github/actions/tag-pruner@v1

An example workflow to delete tags older than 30 days that runs weekly could be:

on:
  schedule:
    - cron: '0 0 * * 0'
name: Tidy up repo tags
jobs:
  prune:
    name: Prune tags
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: nrkno/sofie-github-workflows/.github/actions/tag-pruner@v1
        with:
          older-than: 30
          ignore: v[0-9]+\.[0-9]+\.[0-9]+.*

@PeterC89
PeterC89 requested review from a team and siljekristensen February 23, 2023 14:41
Comment thread .github/actions/tag-pruner/README.md

@siljekristensen siljekristensen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested using this action in another repo?

@PeterC89

Copy link
Copy Markdown
Contributor Author

Have you tested using this action in another repo?

Yes, I built this in one repo and called it from another, seemed to work!

@siljekristensen
siljekristensen self-requested a review February 27, 2023 08:10
Comment thread .github/actions/tag-pruner/action.yml Outdated
@PeterC89
PeterC89 merged commit 14985a2 into main Feb 27, 2023
@PeterC89
PeterC89 deleted the feat/sofie-tag-pruner branch February 27, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants