Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme #23

Merged
merged 6 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,46 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: 'tag-exists-action: true'
id: checkTag
id: exists
uses: ./
with:
tag: 'v1.0.0'
- name: 'tag-exists-action: false'
id: notExist
id: not-exists
uses: ./
with:
tag: 'not-exist-tag-for-testing'
- name: 'tag-exists-action: external repo - true'
id: externalRepoTagExists
id: external-repo-tag-exists
uses: ./
with:
tag: 'v3.6.0'
repo: 'actions/checkout'
- name: 'tag-exists-action: external repo - false'
id: externalRepoTagNotExists
id: external-repo-tag-not-exists
uses: ./
with:
tag: 'not-exist-tag-for-testing'
repo: 'actions/checkout'
- name: 'tag-exists-action: external repo exists - false'
id: externalRepoNotExists
id: external-repo-not-exists
uses: ./
with:
tag: 'not-exist-tag-for-testing'
repo: 'fakeRepo/fakerepo'

- name: Result of checkTag
- name: Result of exists
if: always()
run: test "true" = "${{ steps.checkTag.outputs.exists }}"
- name: Result of notExist
run: test "true" = "${{ steps.exists.outputs.exists }}"
- name: Result of not-exists
if: always()
run: test "false" = "${{ steps.notExist.outputs.exists }}"
- name: Result of externalRepoTagExists
run: test "false" = "${{ steps.not-exists.outputs.exists }}"
- name: Result of external-repo-tag-exists
if: always()
run: test "true" = "${{ steps.externalRepoTagExists.outputs.exists }}"
- name: Result of externalRepoTagNotExists
run: test "true" = "${{ steps.external-repo-tag-exists.outputs.exists }}"
- name: Result of external-repo-tag-not-exists
if: always()
run: test "false" = "${{ steps.externalRepoTagNotExists.outputs.exists }}"
- name: Result of externalRepoNotExists
run: test "false" = "${{ steps.external-repo-tag-not-exists.outputs.exists }}"
- name: Result of external-repo-not-exists
if: always()
run: test "false" = "${{ steps.externalRepoNotExists.outputs.exists }}"
run: test "false" = "${{ steps.external-repo-not-exists.outputs.exists }}"
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,27 @@ A string value of 'true' or 'false'

To check if the tag `v1.0` exists in your repo:
```yaml
- uses: mukunku/tag-exists-action@v1.4.0
id: checkTag
- uses: mukunku/tag-exists-action@v1.5.0
id: check-tag
with:
tag: 'v1.0'

- run: echo ${{ steps.checkTag.outputs.exists }}
- run: echo "Tag exists!"
if: ${{ steps.check-tag.outputs.exists == 'true' }}
```

To check if the tag [`v1.0.0`](https://github.com/actions/checkout/releases/tag/v1.0.0) exists in the repo `actions/checkout`:
```yaml
- uses: mukunku/tag-exists-action@v1.4.0
id: checkTag
- uses: mukunku/tag-exists-action@v1.5.0
id: check-tag
with:
tag: 'v1.0.0'
repo: 'actions/checkout'

- run: echo ${{ steps.checkTag.outputs.exists }}
- run: echo "Tag exists!"
if: steps.check-tag.outputs.exists == 'true' # you can drop ${{ }} on 'if' checks
```

<hr>

This action uses the `${{github.token}}` secret to automatically inject your access token. If you'd like to provide your own token instead check out [this help article](https://github.com/mukunku/tag-exists-action/wiki/Setting-the-GITHUB_TOKEN-explicitly).