-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
6,381 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
name: JS Actions | ||
|
||
on: [push, release] | ||
|
||
jobs: | ||
get_draft: | ||
name: "Get draft release from all releases" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: "call action" | ||
id: last_release | ||
uses: ./ | ||
with: | ||
myToken: ${{ github.token }} | ||
- name: "Print result" | ||
run: | | ||
echo "id: ${{ steps.last_release.outputs.id }}" | ||
echo "tag_name: ${{ steps.last_release.outputs.tag_name }}" | ||
echo "created_at: ${{ steps.last_release.outputs.created_atd }}" | ||
echo "draft: ${{ steps.last_release.outputs.draft }}" | ||
echo "prerelease: ${{ steps.last_release.outputs.prerelease }}" | ||
- name: "Assert" | ||
run: | | ||
if [[ "${{ steps.last_release.outputs.id }}" == "" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.draft }}" != "true" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.prerelease }}" != "false" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
get_prerelease: | ||
name: "Get prerelease release from all releases" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: "call action" | ||
id: last_release | ||
uses: ./ | ||
with: | ||
myToken: ${{ github.token }} | ||
exclude_types: "draft" | ||
- name: "Print result" | ||
run: | | ||
echo "id: ${{ steps.last_release.outputs.id }}" | ||
echo "tag_name: ${{ steps.last_release.outputs.tag_name }}" | ||
echo "created_at: ${{ steps.last_release.outputs.created_atd }}" | ||
echo "draft: ${{ steps.last_release.outputs.draft }}" | ||
echo "prerelease: ${{ steps.last_release.outputs.prerelease }}" | ||
- name: "Assert" | ||
run: | | ||
if [[ "${{ steps.last_release.outputs.id }}" == "" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.draft }}" != "false" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.prerelease }}" != "true" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
get_release: | ||
name: "Get release release from all releases" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: "call action" | ||
id: last_release | ||
uses: ./ | ||
with: | ||
myToken: ${{ github.token }} | ||
exclude_types: "draft|prerelease" | ||
- name: "Print result" | ||
run: | | ||
echo "id: ${{ steps.last_release.outputs.id }}" | ||
echo "tag_name: ${{ steps.last_release.outputs.tag_name }}" | ||
echo "created_at: ${{ steps.last_release.outputs.created_atd }}" | ||
echo "draft: ${{ steps.last_release.outputs.draft }}" | ||
echo "prerelease: ${{ steps.last_release.outputs.prerelease }}" | ||
- name: "Assert" | ||
run: | | ||
if [[ "${{ steps.last_release.outputs.id }}" == "" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.draft }}" != "false" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.prerelease }}" != "false" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
get_zero_because_of_top_list_limit: | ||
name: "Get no release because draft is canceled and limit is set to 1" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: "call action" | ||
id: last_release | ||
uses: ./ | ||
with: | ||
myToken: ${{ github.token }} | ||
exclude_types: "draft" | ||
view_top: 1 | ||
- name: "Print result" | ||
run: | | ||
echo "id: ${{ steps.last_release.outputs.id }}" | ||
echo "tag_name: ${{ steps.last_release.outputs.tag_name }}" | ||
echo "created_at: ${{ steps.last_release.outputs.created_atd }}" | ||
echo "draft: ${{ steps.last_release.outputs.draft }}" | ||
echo "prerelease: ${{ steps.last_release.outputs.prerelease }}" | ||
- name: "Assert" | ||
run: | | ||
if [[ "${{ steps.last_release.outputs.id }}" != "" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.draft }}" != "" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi | ||
if [[ "${{ steps.last_release.outputs.prerelease }}" != "" ]]; | ||
then | ||
echo "Wrong release type" | ||
exit 4 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "toolkit test" | ||
|
||
description: "js action that use github toolkit" | ||
inputs: | ||
myToken: | ||
description: "GitHub Token" | ||
required: true | ||
exclude_types: | ||
description: "Exclude release type (example: draft|prerelease)" | ||
required: false | ||
view_top: | ||
description: "View top releases to find release" | ||
required: false | ||
default: 100 | ||
outputs: | ||
id: | ||
description: 'Id of the release' | ||
tag_name: | ||
description: 'Tag of the release' | ||
created_at: | ||
description: 'Creation date of the release' | ||
draft: | ||
description: 'Release is draft' | ||
prerelease: | ||
description: 'Release is prerelease' | ||
runs: | ||
using: "node12" | ||
main: "dist/index.js" |
Oops, something went wrong.