ci: Fix misformatted Package workflow (#14) #27
Workflow file for this run
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
name: "Test Action" | |
on: | |
push: | |
branches: | |
- "**" | |
jobs: | |
test-action: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: npm install | |
- run: npm run package | |
- run: npm run test | |
- id: default | |
uses: ./ | |
- name: Test current commit hash is used by default | |
uses: prompt/actions-assert@v2 | |
with: | |
assertion: npm://@assertions/is-equal | |
expected: "${{ github.sha }}" | |
actual: "${{ steps.default.outputs.long }}" | |
- id: example | |
uses: ./ | |
with: | |
commit: "734713bc047d87bf7eac9674765ae793478c50d3" | |
- name: Test commit hash is used when provided | |
uses: prompt/actions-assert@v2 | |
with: | |
assertion: npm://@assertions/is-equal | |
expected: "734713bc047d87bf7eac9674765ae793478c50d3" | |
actual: "${{ steps.example.outputs.long }}" | |
- name: Test short commit hash is extracted from long | |
uses: prompt/actions-assert@v2 | |
with: | |
assertion: npm://@assertions/is-equal | |
expected: "734713b" | |
actual: "${{ steps.example.outputs.short }}" | |
- id: invalid-input | |
uses: ./ | |
continue-on-error: true | |
with: | |
commit: "invalid-commit-hash" | |
- id: prefixed | |
uses: ./ | |
with: | |
commit: "734713bc047d87bf7eac9674765ae793478c50d3" | |
prefix: "sha-" | |
- name: Test short is prefixed | |
uses: prompt/actions-assert@v2 | |
with: | |
assertion: npm://@assertions/is-equal | |
expected: "sha-734713b" | |
actual: "${{ steps.prefixed.outputs.short }}" | |
- name: Test long is prefixed | |
uses: prompt/actions-assert@v2 | |
with: | |
assertion: npm://@assertions/is-equal | |
expected: "sha-734713bc047d87bf7eac9674765ae793478c50d3" | |
actual: "${{ steps.prefixed.outputs.long }}" |