Skip to content

Commit

Permalink
Merge pull request #23 from mukunku/adjust-readme-and-tests
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
mukunku authored Dec 15, 2023
2 parents 792215d + 2e0596e commit abb37bc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
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).

0 comments on commit abb37bc

Please sign in to comment.