-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yaml
26 lines (26 loc) · 921 Bytes
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: Set Quay.io image expiration
description: Set Quay.io image expiration
inputs:
tag:
description: Tag to be updated
required: true
expiration:
description: Date parameter passed as date -d, set to false if you want to unset expiration
repository:
description: Quay.io repository in format org/repo
required: true
token:
description: Quay.io OAuth token
required: true
runs:
using: "composite"
steps:
- name: Set Quay.io image expiration
shell: bash
run: |
[ "${{ inputs.expiration }}" = "false" ] && expiration=null || expiration=$(date +"%s" -d "${{ inputs.expiration }}")
curl -X PUT \
-d "{\"expiration\":$expiration}" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${{ inputs.token }}" \
https://quay.io/api/v1/repository/${{ inputs.repository }}/tag/${{ inputs.tag }}