Skip to content

Commit db7bca3

Browse files
committed
chore: update to upstream@v4
1 parent 8abe7d3 commit db7bca3

19 files changed

+174316
-34622
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
day: "saturday"
8+
9+
- package-ecosystem: "npm"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
day: "saturday"

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
security_hardening:
10+
name: Check security hardening
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Clone the repository
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
15+
- name: Ensure SHA pinned actions
16+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@ed00f72a3ca5b6eff8ad4d3ffdcacedb67a21db1
17+
18+
build_test:
19+
name: Build & Test
20+
needs: security_hardening
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Clone the repository
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25+
with:
26+
ref: ${{ github.head_ref }} # https://github.com/stefanzweifel/git-auto-commit-action#checkout-the-correct-branch
27+
- name: Get runs.using version
28+
id: get-runs-using-version
29+
uses: zgosalvez/github-actions-get-action-runs-using-version@49044afc8bfe8dfccd7840b828a7cc4019f08717
30+
- name: Set up Node
31+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
32+
with:
33+
node-version: v${{ steps.get-runs-using-version.outputs.version }}
34+
- name: Cache Node Packages
35+
id: node-cache
36+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
37+
with:
38+
path: ~/.npm
39+
key: node-cache-${{ steps.get-runs-using-version.outputs.prop }}-${{ hashFiles('**/package-lock.json') }}
40+
restore-keys: |
41+
node-cache-${{ steps.get-runs-using-version.outputs.prop }}-
42+
node-cache-
43+
- name: Get Node packages
44+
run: npm ci
45+
- name: Run linter tool
46+
run: npm run lint
47+
- name: Prepare
48+
run: npm run prepare
49+
- uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842
50+
with:
51+
commit_message: Apply `npm run prepare` changes

.github/workflows/version.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Update Major Version Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
update-majorver:
10+
name: Update Major Version Tag
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: nowactions/update-majorver@f2014bbbba95b635e990ce512c5653bd0f4753fb

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ Create a workflow `.yml` file in your `.github/workflows` directory. An [example
1313
For more information on these inputs, see the [Workflow syntax for GitHub Actions](https://docs.github.com/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepswith)
1414

1515
- `coverage-files`: The coverage files to scan. For example, `coverage/lcov.*.info`
16-
- `artifact-name`: The GitHub artifact name of the generated HTML report. For example, `code-coverage-report`. _Note:_ When downloading, it will be extracted in an `html` directory
16+
- `artifact-name`: The GitHub artifact name of the generated HTML report. For example, `code-coverage-report`. _Note:_ When downloading, it will be extracted in an `html` directory. Optional. Default: `` (Skips uploading of artifacts)
1717
- `minimum-coverage`: The minimum coverage to pass the check. Optional. Default: `0` (always passes)
1818
- `github-token`: Set the `${{ secrets.GITHUB_TOKEN }}` token to have the action comment the coverage summary in the pull request. This token is provided by Actions, you do not need to create your own token. Optional. Default: ``
1919
- `working-directory`: The working directory containing the source files referenced in the LCOV files. Optional. Default: `./`
20+
- `title-prefix`: A prefix before the title "LCOV of commit...". Optional. Default: ``
21+
- `additional-message`: Custom text appended to the code coverage comment in the pull request. Optional. Default: ``
22+
- `update-comment`: Set to `true` to update the previous code coverage comment if such exists. When set to `false`, a new comment is always created. Optional. Default: `false`
2023

2124
### Outputs
22-
None.
25+
- `total-coverage`: The total coverage from scanned files.
2326

2427
Sample comment:
2528
![Screenshot](assets/comment.png)
@@ -40,15 +43,23 @@ jobs:
4043
- name: Checkout code
4144
uses: actions/checkout@v2
4245
# ... Generate LCOV files or download it from a different job
46+
- name: Setup LCOV
47+
uses: hrishikesh-kadam/setup-lcov@v1
4348
- name: Report code coverage
44-
uses: mbta/github-actions-report-lcov@v1
49+
uses: zgosalvez/github-actions-report-lcov@v3
4550
with:
4651
coverage-files: coverage/lcov.*.info
4752
minimum-coverage: 90
4853
artifact-name: code-coverage-report
4954
github-token: ${{ secrets.GITHUB_TOKEN }}
5055
working-directory: apps/my-first-app
56+
update-comment: true
5157
```
58+
*Note:* Only the `pull_request` and `pull_request_target` events are supported. This action does nothing when triggered by other event types.
59+
60+
### Flutter Workflows
61+
62+
This is used in my opinionated [GitHub Actions: Flutter Workflows](https://github.com/zgosalvez/github-actions-flutter-workflows) repository along with other actions for a complete end-to-end DevOps experience.
5263

5364
## License
54-
The scripts and documentation in this project are released under the [MIT License](LICENSE)
65+
The scripts and documentation in this project are released under the [MIT License](LICENSE.md)

SECURITY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The following versions of the project are currently being supported with security updates.
6+
7+
| Version | Supported |
8+
| ------- | ------------------ |
9+
| 4.0.x | :white_check_mark: |
10+
| < 4 | :x: |
11+
12+
## Reporting a Vulnerability
13+
14+
Please file an issue.

action.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,32 @@ inputs:
88
description: 'The coverage files to scan. For example, `coverage/lcov.*.info`'
99
required: true
1010
artifact-name:
11-
description: 'The GitHub artifact name of the generated HTML report. For example, `code-coverage-report`. _Note:_ When downloading, it will be extracted in an `html` directory'
12-
required: true
11+
description: 'The GitHub artifact name of the generated HTML report. For example, `code-coverage-report`. _Note:_ When downloading, it will be extracted in an `html` directory. Optional. Default: `` (Skips uploading of artifacts)'
1312
minimum-coverage:
1413
description: 'The minimum coverage to pass the check. Optional. Default: `0` (always passes)'
1514
default: 0
1615
github-token:
1716
description: 'Set the GitHub token to have the action comment the coverage summary in the pull request. This token is provided by Actions, you do not need to create your own token. Optional. Default: ``'
1817
working-directory:
1918
description: 'The working directory containing the source files referenced in the LCOV files. Optional. Default: `./`'
19+
title-prefix:
20+
description: 'A prefix before the title "LCOV of commit...". Optional. Default: ``'
21+
required: false
22+
additional-message:
23+
description: 'Custom text appended to the code coverage comment in the pull request. Optional. Default: ``'
24+
required: false
25+
update-comment:
26+
description: 'Set to `true` to update the previous code coverage comment if such exists. When set to `false`, a new comment is always created. Optional. Default: `false`'
27+
required: false
28+
default: "false"
29+
outputs:
30+
total-coverage:
31+
description: 'The total coverage from scanned files.'
32+
2033
runs:
21-
using: 'node12'
34+
using: 'node20'
2235
main: 'dist/main/index.js'
2336
post: 'dist/post/index.js'
2437
branding:
2538
icon: umbrella
26-
color: purple
39+
color: purple

0 commit comments

Comments
 (0)