ci(fix): move checkout before semantic-release --noop #14
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: Dispatch Test Worfklow | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
Dispatch: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
concurrency: release | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check release status | |
id: release-status | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
pip install python-semantic-release | |
if semantic-release --noop --strict version | |
then | |
echo "Should release new version." | |
else | |
echo "Should not release." | |
fi | |
- uses: actions/github-script@v6 | |
id: dispatch-tests | |
if: steps.release-status.outputs.released == 'true' | |
with: | |
github-token: ${{ secrets.PAT_TOKEN }} | |
script: | | |
await github.rest.actions.createWorkflowDispatch({ | |
owner: 'matteo4diani', | |
repo: 'poetry-semantic-release-test', | |
workflow_id: 'test.yml', | |
ref: 'main' | |
}) |