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 55 pull_request :
66 branches : ['**']
77
8+ # Set minimal permissions by default
9+ permissions :
10+ contents : read
11+
812concurrency :
913 group : ${{ github.workflow }}-${{ github.ref }}
1014 cancel-in-progress : ${{ !contains(github.ref, 'main')}}
1317 install-cache-deps :
1418 runs-on : ubuntu-latest
1519 name : Install and Cache deps
20+ permissions :
21+ contents : read
1622 steps :
1723 - name : Checkout
1824 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2430 needs : [install-cache-deps]
2531 runs-on : ubuntu-latest
2632 name : Lint
33+ permissions :
34+ contents : read
2735 steps :
2836 - name : Checkout
2937 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3846 needs : [install-cache-deps]
3947 runs-on : ubuntu-latest
4048 name : Typecheck
49+ permissions :
50+ contents : read
4151 steps :
4252 - name : Checkout
4353 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5262 needs : [install-cache-deps]
5363 runs-on : ubuntu-latest
5464 name : Test
65+ permissions :
66+ contents : read
5567 steps :
5668 - name : Checkout
5769 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6274 - name : Test
6375 run : yarn test:ci:coverage
6476
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+
65103 - name : Upload coverage to Codecov
66104 uses : codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
67105 env :
71109 needs : [install-cache-deps]
72110 runs-on : ubuntu-latest
73111 name : Test React 18
112+ permissions :
113+ contents : read
74114 steps :
75115 - name : Checkout
76116 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Original file line number Diff line number Diff line change 88 branches : ['**']
99 paths : ['examples/**']
1010
11+ # Set minimal permissions by default
12+ permissions :
13+ contents : read
14+
1115jobs :
1216 test-example :
1317 strategy :
1721 name : Test Example
1822 runs-on : ubuntu-latest
1923 timeout-minutes : 10
24+ permissions :
25+ contents : read
2026 steps :
2127 - name : Checkout
2228 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Original file line number Diff line number Diff line change 88 branches : ['**']
99 paths : ['website/**']
1010
11+ # Set minimal permissions by default
12+ permissions :
13+ contents : read
14+
1115concurrency :
1216 group : ${{ github.workflow }}-${{ github.ref }}
1317 cancel-in-progress : ${{ !contains(github.ref, 'main')}}
1620 test :
1721 runs-on : ubuntu-latest
1822 name : Test Website
23+ permissions :
24+ contents : read
1925 steps :
2026 - name : Checkout
2127 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2834
2935 deploy :
3036 name : Deploy to GitHub Pages
37+ # Only run on push to main (trusted event) - secrets are safe here
3138 if : github.ref == 'refs/heads/main'
3239 runs-on : ubuntu-latest
40+ permissions :
41+ contents : read
42+ pages : write
43+ id-token : write
3344 steps :
3445 - name : Checkout
3546 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
You can’t perform that action at this time.
0 commit comments