Skip to content

Commit

Permalink
Merge pull request #125 from testomatio/upd-publish-job
Browse files Browse the repository at this point in the history
update publishing job to be trigerred by release
  • Loading branch information
olexandr13 committed Jul 20, 2023
2 parents dd66b57 + b7e4fd3 commit 4bff950
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 46 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/publish-beta.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/publish-stable.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish to npm
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm i
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "github-cd-bot@example.com"
- run: npm version ${{ github.event.release.tag_name }}
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
# use "beta" tag if relevant, otherwise use "latest"
tag: ${{ contains(github.event.release.tag_name, 'beta') && 'beta' || 'latest' }}

# push the version changes to GitHub
- run: git push
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 3 additions & 5 deletions src/lib/frameworks/playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = (ast, file = '', source = '', opts = {}) => {
}
}
}

if (path.isIdentifier({ name: 'parallel' })) {
if (!path.parentPath && !path.parentPath.container) return;
if (!hasStringOrTemplateArgument(path.parentPath.container)) return;
Expand Down Expand Up @@ -82,8 +82,7 @@ module.exports = (ast, file = '', source = '', opts = {}) => {
return;
}

const name =
path.parent.object.name || path.parent.object.property.name || path.parent.object.callee.object.name;
const name = path.parent.object.name || path.parent.object.property.name || path.parent.object.callee.object.name;

if (name === 'test' || name === 'it') {
// test or it
Expand Down Expand Up @@ -118,8 +117,7 @@ module.exports = (ast, file = '', source = '', opts = {}) => {
return;
}

const name =
path.parent.object.name || path.parent.object.property.name || path.parent.object.callee.object.name;
const name = path.parent.object.name || path.parent.object.property.name || path.parent.object.callee.object.name;

if (name === 'test' || name === 'it') {
// test or it
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ function getCode(source, start, end, isLineNumber = false) {
}

const block = lines.slice(start - 1, end).join('\n') + '\n\n';

return block;
}

Expand Down

0 comments on commit 4bff950

Please sign in to comment.