Skip to content

Commit

Permalink
test: check version
Browse files Browse the repository at this point in the history
  • Loading branch information
kuisathaverat committed Feb 16, 2024
1 parent 51fc5ee commit a8df5ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: make it-test
release:
runs-on: ubuntu-latest
needs: [lint, test-python]
# needs: [lint, test-python]
permissions:
# write permission is required to create a github release
contents: write
Expand All @@ -72,18 +72,20 @@ jobs:
with:
script: |
const fs = require('fs');
const version = fs.readFileSync('src/pytest_otel/__init__.py', 'utf8').match(/__version__ = (.*)/)[1].trim();
const version = fs.readFileSync('src/pytest_otel/__init__.py', 'utf8').match(/__version__ = (.*)/)[1].trim().replace(/"/g, '');
const { data: latestRelease } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
})
if (latestRelease.tag_name === version) {
if (`${latestRelease.tag_name}` == `v${version}` ) {
core.setOutput('release', 'false' );
} else {
core.setOutput('release', 'true' );
core.setOutput('version', version );
}
core.info(`version: v${version}`);
core.info(`latestRelease: ${latestRelease.tag_name}`);
- name: Release
if: ${{ steps.check_version.outputs.release == 'true'}}
id: release
Expand Down

0 comments on commit a8df5ee

Please sign in to comment.