Skip to content

Commit

Permalink
fix: update test skip logic to use custom env (#2242)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Aug 21, 2024
1 parent 246859d commit b4c0974
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ jobs:

- name: Run build and test
run: |
env
yarn all
env:
GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FORK: ${{ github.event.pull_request.head.repo.fork }}

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v20
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ describe('utils test', () => {
})
describe('getPreviousGitTag', () => {
// Check if the environment variable GITHUB_REPOSITORY_OWNER is 'tj-actions'
const shouldSkip = process.env.GITHUB_REPOSITORY_OWNER !== 'tj-actions'
const shouldSkip = !!process.env.GITHUB_EVENT_PULL_REQUEST_HEAD_REPO_FORK
// Function returns the second-latest tag and its SHA
it('should return the second latest tag and its SHA when multiple tags are present', async () => {
if (shouldSkip) {
Expand Down

0 comments on commit b4c0974

Please sign in to comment.