-
Notifications
You must be signed in to change notification settings - Fork 0
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
2,080 additions
and
24 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,32 @@ | ||
name: E2E | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
e2e-default: | ||
runs-on: ubuntu-20.04 | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test Get Tag Info | ||
uses: ./ | ||
with: | ||
owner: ovsds | ||
repo: push-version-tags-action | ||
name: v1 | ||
|
||
- name: Validate Results | ||
run: | | ||
# Validate exists equals true | ||
exists=${{ steps.get-tag.outputs.exists }} | ||
[[ "$exists" == "true" ]] || {echo 'Output `exists` does not equal "true"'; false} |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname $0)/.huskyrc" | ||
. "$(dirname $0)/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit | ||
npx --no -- commitlint --edit |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname $0)/.huskyrc" | ||
. "$(dirname $0)/_/husky.sh" | ||
|
||
|
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
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
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 |
---|---|---|
@@ -1,27 +1,81 @@ | ||
name: "Get Tag Info Action" | ||
description: "Get Tag Info Action" | ||
name: "Get Tag Info" | ||
description: "Returns tag information for the given tag name" | ||
|
||
inputs: | ||
placeholder: | ||
description: "Placeholder input to be replaced by real inputs" | ||
github_token: | ||
description: "Github token used for API calls. Required scope - 'contents: read'" | ||
|
||
owner: | ||
description: "Owner of the repository" | ||
|
||
repo: | ||
description: "Repository name" | ||
|
||
tag_name: | ||
description: "Target tag name" | ||
required: true | ||
default: "placeholder" | ||
|
||
outputs: | ||
placeholder: | ||
description: "Placeholder output to be replaced by real outputs" | ||
value: ${{steps.placeholder.outputs.placeholder }} | ||
exists: | ||
description: "Tag exists" | ||
value: ${{ steps.get-ref.outputs.exists }} | ||
|
||
tag_name: | ||
description: "Tag name" | ||
value: ${{ steps.get-tag.outputs.tag }} | ||
|
||
tag_sha: | ||
description: "Tag SHA" | ||
value: ${{ steps.get-tag.outputs.sha }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Placeholder | ||
id: placeholder | ||
- name: Ensure owner | ||
id: ensure-owner | ||
shell: bash | ||
run: | | ||
# Ensuring `owner` input, using repository owner if not provided | ||
owner=${{ inputs.owner }} | ||
if [[ -z "$owner" ]]; then | ||
owner=${{ github.repository_owner }} | ||
fi | ||
echo "owner=${owner}" >> $GITHUB_OUTPUT | ||
- name: Ensure repo | ||
id: ensure-repo | ||
shell: bash | ||
run: | | ||
# Ensuring `repo` input, using repository if not provided | ||
repo=${{ inputs.repo }} | ||
if [[ -z "$repo" ]]; then | ||
repo=${{ github.event.repository.name }} | ||
fi | ||
echo "repo=${repo}" >> $GITHUB_OUTPUT | ||
- name: Ensure token | ||
id: ensure-token | ||
shell: bash | ||
run: | | ||
# Ensuring `github_token` input, using `github.token` variable if not provided | ||
github_token=${{ inputs.github_token }} | ||
if [[ -z "$github_token" ]]; then | ||
github_token=${{ github.token }} | ||
fi | ||
echo "github_token=${github_token}" >> $GITHUB_OUTPUT | ||
- name: Get ref | ||
id: get-ref | ||
shell: bash | ||
run: | | ||
echo "::set-output name=placeholder::${{ inputs.placeholder }}" | ||
# Getting tag ref information | ||
gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ steps.ensure-owner.outputs.owner }}/${{ steps.ensure-repo.outputs.repo }}/git/refs/tags/${{ inputs.tag_name }} | ||
env: | ||
GH_TOKEN: ${{ steps.ensure-token.outputs.github_token }} | ||
|
||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding | ||
branding: | ||
icon: "message-square" | ||
icon: "tag" | ||
color: "gray-dark" |
Oops, something went wrong.