Shion のもくログ(旧: Shion の技術メモ)

使った技術のメモや、うまくいかなかった事とかを綴ります

PR

2024/12/14 ~ 2024/12/20 のもくもく日記

もくもく 前回までは

2024/12/07 ~ 2024/12/13 のもくもく日記 をご覧ください。

途中経過

その1

name: Automatically delete temporary artifacts sample

on:
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: true

jobs:
  remain:
    runs-on: ubuntu-22.04
    timeout-minutes: 1
    steps:
      - run: echo "remain" > sample-remain.txt

      - uses: actions/upload-artifact@v4
        with:
          name: sample-remain
          path: sample-remain.txt

  auto-delete:
    runs-on: ubuntu-22.04
    timeout-minutes: 1
    steps:
      - run: echo "auto-delete" > sample-delete.txt

      - uses: actions/upload-artifact@v4
        id: upload
        with:
          name: sample-delete
          path: sample-delete.txt

      - name: Delete upload artifact
        env:
          GH_TOKEN: ${{ secrets.GH_PAT_REPO }}
          ID: ${{ steps.upload.outputs.artifact-id }}
          REPO: ${{ github.repository }}
        run: |
          gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "/repos/${REPO}/actions/artifacts/${ID}"

今回の進捗

※関連SNS
PR