ハマログ

株式会社イーツー・インフォの社員ブログ

GitHub ActionsのArtifactを削除したい

GitHub ActionsのArtifactの上限よくわからなかったんだけど、無料で利用している場合、、おそらく2GBっぽい。 上限に達すると以下のエラーとなり、アップロードができなくなります。
Cannot upload artifacts. You may have exceeded your spending limit for storing artifacts with Actions or Packages.  
Artifactは90日で自動削除されるのですが、ビルド頻度によっては削除されるのを待っていられないため、古いArtifactを自動的に削除する設定をいれてみました。

手順

gha-remove-artifactsを利用しました。
https://github.com/c-hive/gha-remove-artifacts
name: Java CI with Maven

on:
  push:
    branches: [ development ]

jobs:
  remove-old-artifacts:
    runs-on: ubuntu-latest
    timeout-minutes: 10

    steps:
    - name: Remove old artifacts
      uses: c-hive/gha-remove-artifacts@v1
      with:
        age: '1 weeks'
        # Optional inputs
        # skip-tags: true
        # skip-recent: 5

  build:
    runs-on: ubuntu-latest
    (略)
削除できました
注意
c-hive/gha-remove-artifactsは公式製品ではなくオープンソースなので、その旨理解の上、事前に動作確認してから導入してください。
gitgithubGitHub Actions

  kaneko tomo   2020年11月12日


関連記事

jQuery セレクターのエスケープ

Javaフレームワークとの兼ね合いで、HTML要素のidを「items[0].c…

LINE Messaging APIのテスト(はじめに)

LINE Messaging APIを試してみました。 https://busi…

LaravelのEloquent,Query Builderで値をランダムソートする

検証環境 PHP5.6 Laravel5.3 Laravel5.2からEloqu…


← 前の投稿

次の投稿 →