-
Notifications
You must be signed in to change notification settings - Fork 0
test: fix tests for github action #1037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
c095c9c
5d19513
ee735c6
064e6b2
ab7fd65
1a85a17
19997e8
9203b0e
e88607d
d53b6c8
ff5b185
3205021
c66640d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,35 +1,35 @@ | ||||||||||||||||||||||
| # name: Unit Test | ||||||||||||||||||||||
| name: Unit Test | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # on: | ||||||||||||||||||||||
| # pull_request: | ||||||||||||||||||||||
| # types: [assigned, opened, synchronize, reopened] | ||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||
| types: [assigned, opened, synchronize, reopened] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # jobs: | ||||||||||||||||||||||
| # unit-test: | ||||||||||||||||||||||
| # permissions: write-all | ||||||||||||||||||||||
| # runs-on: ubuntu-latest | ||||||||||||||||||||||
| # steps: | ||||||||||||||||||||||
| # - uses: actions/checkout@v1 | ||||||||||||||||||||||
| # - name: Setup GitHub Action | ||||||||||||||||||||||
| # uses: actions/setup-node@v1 | ||||||||||||||||||||||
| # with: | ||||||||||||||||||||||
| # node-version: 14.18 | ||||||||||||||||||||||
| # - name: Install dependencies | ||||||||||||||||||||||
| # run: npm install | ||||||||||||||||||||||
| # - name: Test | ||||||||||||||||||||||
| # run: npm run unit_test:ci | ||||||||||||||||||||||
| # env: | ||||||||||||||||||||||
| # FYLE_CLIENT_ID: "lolo" | ||||||||||||||||||||||
| # CALLBACK_URI: "http://lolo.fyle.tech/callback" | ||||||||||||||||||||||
| # API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| # FYLE_APP_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| # SI_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| # SAGE300_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| # - name: Unit Test Coverage | ||||||||||||||||||||||
| # uses: fylein/comment-test-coverage@master | ||||||||||||||||||||||
| # with: | ||||||||||||||||||||||
| # token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||
| # path: coverage/coverage-summary.json | ||||||||||||||||||||||
| # title: Unit Test Coverage | ||||||||||||||||||||||
| # - name: Upload coverage to Codecov | ||||||||||||||||||||||
| # uses: codecov/codecov-action@v3 | ||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| unit-test: | ||||||||||||||||||||||
| permissions: write-all | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
|
Comment on lines
+7
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yo, these permissions are whack, let's dial 'em back! Listen up, dawg, I'm spittin' facts, Here's the fix, so take note: jobs:
unit-test:
- permissions: write-all
+ permissions: read-all
runs-on: ubuntu-latestWe're keepin' it tight, no slack, 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
| - uses: actions/checkout@v1 | ||||||||||||||||||||||
| - name: Setup GitHub Action | ||||||||||||||||||||||
| uses: actions/setup-node@v1 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| node-version: 22.2.0 | ||||||||||||||||||||||
|
Comment on lines
+12
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yo, these actions are old school, we need a new rule! Listen up, I'm about to school ya, - - uses: actions/checkout@v1
+ - uses: actions/checkout@v3
- name: Setup GitHub Action
- uses: actions/setup-node@v1
+ uses: actions/setup-node@v3
with:
- node-version: 22.2.0
+ node-version: 18We're rollin' with LTS, that's how we flex, 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint
|
||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||
| run: npm install | ||||||||||||||||||||||
| - name: Test | ||||||||||||||||||||||
| run: npm run unit_test:ci | ||||||||||||||||||||||
| env: | ||||||||||||||||||||||
| FYLE_CLIENT_ID: "lolo" | ||||||||||||||||||||||
| CALLBACK_URI: "http://lolo.fyle.tech/callback" | ||||||||||||||||||||||
| CLUSTER_DOMAIN_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| FYLE_APP_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| SI_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| SAGE300_API_URL: "http://lolo.fyle.tech" | ||||||||||||||||||||||
| - name: Unit Test Coverage | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yo, these env vars are whack, they need a new track! Listen up, homies, I'm droppin' knowledge, So here's the deal, let's make it clear, Example: env:
FYLE_CLIENT_ID: ${{ secrets.FYLE_CLIENT_ID }}
CALLBACK_URI: ${{ secrets.CALLBACK_URI }}
# ... and so on for other variablesKeep it secure, that's how we roll, 🧰 Tools🪛 yamllint
|
||||||||||||||||||||||
| uses: fylein/comment-test-coverage@master | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||
| path: coverage/coverage-summary.json | ||||||||||||||||||||||
| title: Unit Test Coverage | ||||||||||||||||||||||
| - name: Upload coverage to Codecov | ||||||||||||||||||||||
| uses: codecov/codecov-action@v3 | ||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yo, these permissions are too high, we gotta bring 'em down low!
Listen up, I'm spittin' truth, no lies,
'write-all' perms? That's askin' for surprise!
For unit tests, we don't need that much power,
Let's lock it down, make our security tower!
Here's the fix, so take note:
We're keepin' it tight, no slack,
'Cause in this security game, there's no turnin' back!
📝 Committable suggestion