Skip to content

Commit 91553aa

Browse files
author
Lasim
committed
fix: update backend release workflow to use app token for GitHub actions
13 parents 7f27659 + ef10230 + 54d38b8 + 5e9ed8a + 920fac2 + c75e00f + 04fd3c8 + 73ca692 + a031b36 + 5a1b695 + 8bf6d78 + 635ec2a + 0639a34 commit 91553aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4466
-472
lines changed

.github/workflows/backend-release-pr.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
- uses: actions/checkout@v4
3131
with:
3232
fetch-depth: 0
33+
# Use the app token for checkout as well
34+
token: ${{ secrets.APP_INSTALLATION_TOKEN }}
3335
- name: git config
3436
run: |
3537
git config user.name "${GITHUB_ACTOR}"
@@ -42,7 +44,7 @@ jobs:
4244
- run: npm ci
4345
- name: Prepare release
4446
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.APP_INSTALLATION_TOKEN }}
4648
TYPE_ARG: ${{ fromJSON('{"auto":"", "patch":"patch", "minor":"minor", "major":"major"}')[github.event.inputs.type] }}
4749
BETA_ARG: ${{ github.event.inputs.beta == 'true' && '--preRelease=beta' || '' }}
4850
run: npm run release -- $TYPE_ARG --ci --verbose --no-git.push --no-git.commit --no-git.tag --no-github $BETA_ARG
@@ -60,6 +62,8 @@ jobs:
6062
uses: peter-evans/create-pull-request@v7
6163
id: cpr
6264
with:
65+
# This is the key change - use the app token
66+
token: ${{ secrets.APP_INSTALLATION_TOKEN }}
6367
branch: backend-release
6468
delete-branch: true
6569
commit-message: 'chore(backend): release v${{ steps.package-version.outputs.current-version}}'

package-lock.json

Lines changed: 622 additions & 352 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/backend/DB.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@ To perform the initial setup of the database, use the following endpoint:
2626

2727
**For SQLite:**
2828
The server will automatically manage the database file location. The request body should be:
29+
2930
```json
3031
{
3132
"type": "sqlite"
3233
}
3334
```
35+
3436
The SQLite database file will be created and stored at: `services/backend/persistent_data/database/deploystack.db`.
3537

3638
**For PostgreSQL:**
3739
The request body should be:
40+
3841
```json
3942
{
4043
"type": "postgres",
4144
"connectionString": "postgresql://username:password@host:port/mydatabase"
4245
}
4346
```
47+
4448
Replace the `connectionString` with your actual PostgreSQL connection URI.
4549

4650
**Important:** After the initial database setup via this API, you **must restart the backend server** for the changes to take full effect and for the application to connect to the newly configured database.
@@ -158,6 +162,8 @@ Tables defined by plugins are automatically created when the plugin is loaded an
158162
- Include proper foreign key constraints for relational data
159163
- Add explicit types for all columns
160164
- Always use migrations for schema changes in development and production
165+
- **Important**: When adding foreign key relationships, update the dialect-specific schema files (e.g., `src/db/schema.sqlite.ts`) rather than the central `schema.ts` file, as Drizzle Kit uses these files for migration generation
166+
- Never manually create migration files - always use `npm run db:generate` to ensure proper migration structure
161167
162168
## Inspecting the Database
163169
@@ -168,6 +174,7 @@ You can inspect the SQLite database directly using various tools:
168174
```bash
169175
sqlite3 services/backend/persistent_data/database/deploystack.db
170176
```
177+
171178
(Assuming the command is run from the project root directory)
172179
173180
- **Visual Tools**: [DB Browser for SQLite](https://sqlitebrowser.org/) or VSCode extensions like SQLite Viewer

services/backend/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ services/backend/
8484
The `services/backend/persistent_data/` directory is designated for storing all data that needs to persist across application restarts or deployments.
8585

8686
**Purpose:**
87+
8788
- To provide a single, consistent location for all persistent backend data.
8889
- When developing backend features that require data persistence (e.g., database files, configuration files that should not be in version control but are generated/modified at runtime), use this directory exclusively.
8990

9091
**Examples of data stored here:**
92+
9193
- SQLite database file (e.g., `persistent_data/database/deploystack.db`)
9294
- Database selection configuration (e.g., `persistent_data/db.selection.json`)
9395

0 commit comments

Comments
 (0)