-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathaction.yml
More file actions
27 lines (24 loc) · 967 Bytes
/
action.yml
File metadata and controls
27 lines (24 loc) · 967 Bytes
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
27
name: check_if_latest_release
description: Check if the current release is the latest release
inputs:
token:
description: "Github API token"
runs:
using: composite
steps:
- name: Check if latest release
run: |-
RELEASE_JSON=$(curl -s -H "Authorization: token ${{ inputs.token }}" \
"https://api.github.com/repos/${{ github.repository }}/releases/latest")
LATEST_TAG_NAME=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
RELEASE_EVENT_TAG_NAME=$(echo ${{ github.event.release.tag_name }})
echo "Latest tag: $LATEST_TAG_NAME"
echo "Release event tag: $RELEASE_EVENT_TAG_NAME"
if [ "$LATEST_TAG_NAME" == "$RELEASE_EVENT_TAG_NAME" ]; then
echo "We are releasing the latest tag."
echo "IS_LATEST_RELEASE=true" >> $GITHUB_ENV
else
echo "We are not releasing the latest tag."
echo "IS_LATEST_RELEASE=false" >> $GITHUB_ENV
fi
shell: bash