File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 5
5
pull_request :
6
6
branches : ['**']
7
7
8
+ # Set minimal permissions by default
9
+ permissions :
10
+ contents : read
11
+
8
12
concurrency :
9
13
group : ${{ github.workflow }}-${{ github.ref }}
10
14
cancel-in-progress : ${{ !contains(github.ref, 'main')}}
13
17
install-cache-deps :
14
18
runs-on : ubuntu-latest
15
19
name : Install and Cache deps
20
+ permissions :
21
+ contents : read
16
22
steps :
17
23
- name : Checkout
18
24
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24
30
needs : [install-cache-deps]
25
31
runs-on : ubuntu-latest
26
32
name : Lint
33
+ permissions :
34
+ contents : read
27
35
steps :
28
36
- name : Checkout
29
37
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38
46
needs : [install-cache-deps]
39
47
runs-on : ubuntu-latest
40
48
name : Typecheck
49
+ permissions :
50
+ contents : read
41
51
steps :
42
52
- name : Checkout
43
53
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52
62
needs : [install-cache-deps]
53
63
runs-on : ubuntu-latest
54
64
name : Test
65
+ permissions :
66
+ contents : read
55
67
steps :
56
68
- name : Checkout
57
69
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
62
74
- name : Test
63
75
run : yarn test:ci:coverage
64
76
77
+ - name : Upload coverage reports
78
+ uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
79
+ with :
80
+ name : coverage-reports
81
+ path : coverage/
82
+ retention-days : 1
83
+
84
+ # Separate job for codecov upload that only runs on trusted events
85
+ upload-coverage :
86
+ needs : [test]
87
+ runs-on : ubuntu-latest
88
+ name : Upload Coverage
89
+ # Only run on push to main (trusted event) to avoid exposing secrets to forks
90
+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
91
+ permissions :
92
+ contents : read
93
+ steps :
94
+ - name : Checkout
95
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
96
+
97
+ - name : Download coverage reports
98
+ uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
99
+ with :
100
+ name : coverage-reports
101
+ path : coverage/
102
+
65
103
- name : Upload coverage to Codecov
66
104
uses : codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
67
105
env :
71
109
needs : [install-cache-deps]
72
110
runs-on : ubuntu-latest
73
111
name : Test React 18
112
+ permissions :
113
+ contents : read
74
114
steps :
75
115
- name : Checkout
76
116
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Original file line number Diff line number Diff line change 8
8
branches : ['**']
9
9
paths : ['examples/**']
10
10
11
+ # Set minimal permissions by default
12
+ permissions :
13
+ contents : read
14
+
11
15
jobs :
12
16
test-example :
13
17
strategy :
17
21
name : Test Example
18
22
runs-on : ubuntu-latest
19
23
timeout-minutes : 10
24
+ permissions :
25
+ contents : read
20
26
steps :
21
27
- name : Checkout
22
28
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Original file line number Diff line number Diff line change 8
8
branches : ['**']
9
9
paths : ['website/**']
10
10
11
+ # Set minimal permissions by default
12
+ permissions :
13
+ contents : read
14
+
11
15
concurrency :
12
16
group : ${{ github.workflow }}-${{ github.ref }}
13
17
cancel-in-progress : ${{ !contains(github.ref, 'main')}}
16
20
test :
17
21
runs-on : ubuntu-latest
18
22
name : Test Website
23
+ permissions :
24
+ contents : read
19
25
steps :
20
26
- name : Checkout
21
27
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28
34
29
35
deploy :
30
36
name : Deploy to GitHub Pages
37
+ # Only run on push to main (trusted event) - secrets are safe here
31
38
if : github.ref == 'refs/heads/main'
32
39
runs-on : ubuntu-latest
40
+ permissions :
41
+ contents : read
42
+ pages : write
43
+ id-token : write
33
44
steps :
34
45
- name : Checkout
35
46
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
You can’t perform that action at this time.
0 commit comments