0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Githubで過去アーティファクトを削除をJob

Posted at

事象

githubの無料プランを使っていますが、Storageを消費しきれると、Jobが実行できなくなります。
そのため、過去のアーティファクトを削除するジョブを追加しました。

image.png

やり方

以下のソースを.github/worlflows配下に配置し、githubにプッシュすれば、ジョブが定期的に自動実行されます。

name: Remove all artifacts manually

on:
  schedule:
    - cron: '0 0 * * *'  # 毎日午前0時に実行
  workflow_dispatch:  # 手動で実行できるようにする

jobs:
  remove-old-artifacts:
    runs-on: ubuntu-latest

    steps:
      - name: Remove all artifacts
        uses: c-hive/gha-remove-artifacts@v1
        with:
          age: '1 days' 
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?