Skip to content

Commit aeaff48

Browse files
authored
ci: add GITHUB_TOKEN environment variable for testing in release workflow (#147)
* ci: add GITHUB_TOKEN environment variable for testing in release workflow * fix: ensure tags test uses beforeEach from vitest
1 parent fb751d4 commit aeaff48

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/workflows/release-start.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747

4848
- name: Run Tests Typescript
4949
run: npm run test
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO_CI_TESTING }}
5052

5153
- name: Update Coverage Badge
5254
run: npm run coverage

__tests__/tags.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { beforeEach } from 'node:test';
21
import { config } from '@/mocks/config';
32
import { context } from '@/mocks/context';
43
import { deleteLegacyTags, getAllTags } from '@/tags';
54
import { stubOctokitReturnData } from '@/tests/helpers/octokit';
65
import { debug, endGroup, info, startGroup } from '@actions/core';
76
import { RequestError } from '@octokit/request-error';
8-
import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
7+
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
98

109
describe('tags', () => {
1110
const url = 'https://api.github.com/repos/techpivot/terraform-module-releaser/tags';

__tests__/terraform-docs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('terraform-docs', async () => {
184184
expect(() => installTerraformDocs(terraformDocsVersion)).toThrow('not found: invalid-non-existent-binary');
185185
});
186186

187-
afterAll(() => {
187+
afterAll(() => {
188188
mockWhichSync.mockRestore();
189189
});
190190
});

0 commit comments

Comments
 (0)