Skip to content

Commit 6fcda38

Browse files
committed
chore: add gha workflows
1 parent ca5b9f3 commit 6fcda38

14 files changed

Lines changed: 2314 additions & 1339 deletions
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Go to '...'
16+
2. Execute '...'
17+
3. See error
18+
19+
## Expected Behavior
20+
21+
A clear and concise description of what you expected to happen.
22+
23+
## Actual Behavior
24+
25+
A clear and concise description of what actually happened.
26+
27+
## Code Sample
28+
29+
```javascript
30+
// Minimal code to reproduce the issue
31+
```
32+
33+
## Environment
34+
35+
- OS: [e.g. macOS 13.0, Windows 11, Ubuntu 22.04]
36+
- Package Version: [e.g. 1.2.3]
37+
- Node Version: [e.g. 18.0.0]
38+
- Package Manager: [e.g. npm 9.0.0, yarn 1.22.0]
39+
40+
## Error Messages/Logs
41+
42+
```
43+
Paste any error messages or relevant logs here
44+
```
45+
46+
## Screenshots
47+
48+
If applicable, add screenshots to help explain your problem.
49+
50+
## Additional Context
51+
52+
Add any other context about the problem here.
53+
54+
## Possible Solution
55+
56+
If you have suggestions on how to fix the bug, please describe them here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Question or Discussion
4+
url: https://github.com/contentful/contentful-management/discussions
5+
about: Ask questions or discuss ideas with the community
6+
- name: Documentation
7+
url: https://docs.yourproject.com
8+
about: Check out our documentation for help and guides
9+
- name: Security Vulnerability
10+
url: https://github.com/contentful/contentful-management/security/advisories/new
11+
about: Report a security vulnerability privately
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem Statement
14+
15+
Is your feature request related to a problem? Please describe.
16+
Example: I'm always frustrated when [...]
17+
18+
## Proposed Solution
19+
20+
A clear and concise description of what you want to happen.
21+
22+
## Use Case
23+
24+
Describe the use case for this feature. How would you use it?
25+
26+
```javascript
27+
// Example of how the feature would be used
28+
const example = new Feature({
29+
option: 'value',
30+
});
31+
```
32+
33+
## Alternatives Considered
34+
35+
A clear and concise description of any alternative solutions or features you've considered.
36+
37+
## Benefits
38+
39+
What are the benefits of implementing this feature?
40+
41+
- Benefit 1
42+
- Benefit 2
43+
- Benefit 3
44+
45+
## Potential Drawbacks
46+
47+
Are there any potential drawbacks or challenges with this feature?
48+
49+
## Additional Context
50+
51+
Add any other context, screenshots, or examples about the feature request here.
52+
53+
## Implementation Suggestions
54+
55+
If you have ideas about how this could be implemented, please share them here.
56+
57+
## Priority
58+
59+
How important is this feature to you?
60+
61+
- [ ] Critical - Blocking my usage
62+
- [ ] High - Important for my use case
63+
- [ ] Medium - Would be nice to have
64+
- [ ] Low - Just a suggestion
65+
66+
## Willingness to Contribute
67+
68+
- [ ] I'd be willing to submit a PR for this feature
69+
- [ ] I can help test this feature
70+
- [ ] I can help with documentation

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
Thank you for opening a pull request.
33
4-
Please fill in as much of the template below as you're able. Feel free to delete
4+
Please fill in as much of the template below as you're able. Feel free to remove
55
any section you want to skip.
66
-->
77

@@ -20,16 +20,10 @@ Why is this change required? What problem does it solve?
2020
If it fixes an open issue, please link to the issue here.
2121
-->
2222

23-
## Checklist (check all before merging)
23+
## PR Checklist
2424

25-
- [ ] Both unit and integration tests are passing
25+
- [ ] I have read the `CONTRIBUTING.md` file
26+
- [ ] All commits follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
27+
- [ ] Documentation is updated (if necessary)
28+
- [ ] PR doesn't contain any sensitive information
2629
- [ ] There are no breaking changes
27-
- [ ] Changes are reflected in the documentation
28-
29-
When adding a new method:
30-
31-
- [ ] The new method is exported through the default and plain CMA client
32-
- [ ] All new public types are exported from `./lib/export-types.ts`
33-
- [ ] Added a unit test for the new method
34-
- [ ] Added an integration test for the new method
35-
- [ ] The new method is added to the documentation

.github/dependabot.yml

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
version: 2
2-
registries:
3-
npm-github:
4-
type: npm-registry
5-
url: https://npm.pkg.github.com
6-
token: ${{secrets.NPM_REGISTRY_REGISTRY_GH_ORG_TOKEN}}
72
updates:
8-
- package-ecosystem: npm
9-
versioning-strategy: lockfile-only
10-
registries:
11-
- npm-github
12-
directory: "/"
3+
# Enable version updates for npm
4+
- package-ecosystem: 'npm'
5+
directory: '/'
136
schedule:
14-
interval: daily
15-
time: "00:00"
16-
timezone: UTC
7+
interval: 'weekly'
8+
day: 'monday'
179
open-pull-requests-limit: 10
10+
reviewers:
11+
- 'contentful/team-developer-experience'
12+
labels:
13+
- 'dependencies'
14+
commit-message:
15+
prefix: 'chore'
16+
include: 'scope'
1817
ignore:
1918
- dependency-name: husky
2019
versions:
@@ -25,27 +24,3 @@ updates:
2524
- dependency-name: webpack
2625
versions:
2726
- '>= 5.0.0'
28-
# requires node@18
29-
- dependency-name: semantic-release
30-
versions:
31-
- '>= 20.0.0'
32-
commit-message:
33-
prefix: build
34-
include: scope
35-
groups:
36-
production-dependencies:
37-
applies-to: version-updates
38-
dependency-type: production
39-
update-types:
40-
- minor
41-
- patch
42-
patterns:
43-
- '*'
44-
dev-dependencies:
45-
applies-to: version-updates
46-
dependency-type: development
47-
update-types:
48-
- minor
49-
- patch
50-
patterns:
51-
- '*'

.github/workflows/build.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
16+
- name: Checkout code
17+
uses: actions/checkout@v5
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: '22'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build
29+
run: npm run build
30+
31+
- name: Check build artifacts
32+
run: ls -la dist/
33+
34+
- name: Save Build folders
35+
uses: actions/cache/save@v4
36+
with:
37+
path: |
38+
dist
39+
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}

.github/workflows/check.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Run Checks
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
contents: read
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v5
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v6
19+
with:
20+
node-version: '22'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Restore the build folders
27+
uses: actions/cache/restore@v4
28+
with:
29+
path: |
30+
dist
31+
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
32+
33+
- name: Run linter
34+
run: npm run lint
35+
36+
- name: Check formatting
37+
run: npm run format:check
38+
39+
- name: Run unit tests
40+
run: npm run test:unit:cover
41+
42+
- name: Test package size
43+
run: npm run test:size

.github/workflows/codeql.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ name: "CodeQL Scan for GitHub Actions Workflows"
33

44
on:
55
push:
6-
branches: [main, master]
7-
paths: [".github/workflows/**"]
8-
pull_request:
9-
branches: [main, master]
6+
branches: [main]
107
paths: [".github/workflows/**"]
118

129
jobs:
@@ -19,14 +16,14 @@ jobs:
1916
security-events: write
2017

2118
steps:
22-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2320

2421
- name: Initialize CodeQL
25-
uses: github/codeql-action/init@v3
22+
uses: github/codeql-action/init@v4
2623
with:
2724
languages: actions
2825

2926
- name: Run CodeQL Analysis
30-
uses: github/codeql-action/analyze@v3
27+
uses: github/codeql-action/analyze@v4
3128
with:
3229
category: actions

.github/workflows/main.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches: ['**']
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/build.yaml
12+
13+
check:
14+
needs: build
15+
uses: ./.github/workflows/check.yaml
16+
17+
test-integration:
18+
needs: [build, check]
19+
uses: ./.github/workflows/test-integration.yaml
20+
secrets: inherit
21+
22+
release:
23+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/canary' || github.ref == 'refs/heads/dx-542-update-to-gha')
24+
needs: [build, check, test-integration]
25+
permissions:
26+
contents: write
27+
id-token: write
28+
actions: read
29+
uses: ./.github/workflows/release.yaml
30+
secrets:
31+
VAULT_URL: ${{ secrets.VAULT_URL }}

0 commit comments

Comments
 (0)