mirror of
https://github.com/vastsa/FileCodeBoxFronted.git
synced 2026-11-24 21:58:01 +08:00
fix: validate frontend pushes without release permissions
This commit is contained in:
1 parent
3cb12e4202
commit
19a208b6a2
2 files changed
+20
-35
No files matched your search
@@ -1,4 +1,4 @@
|
||||
name: Release Please
|
||||
name: Build frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -7,41 +7,27 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
contents: write
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: release-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
group: frontend-build-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
release:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- id: release
|
||||
uses: googleapis/release-please-action@v4
|
||||
with:
|
||||
config-file: release-please-config.json
|
||||
manifest-file: .release-please-manifest.json
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Merge release pull request
|
||||
if: ${{ steps.release.outputs.prs_created == 'true' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
RELEASE_PR_JSON: ${{ steps.release.outputs.pr }}
|
||||
run: |
|
||||
RELEASE_PR="$(jq -r '.number' <<< "$RELEASE_PR_JSON")"
|
||||
for attempt in {1..120}; do
|
||||
if gh pr merge "$RELEASE_PR" --squash --delete-branch; then
|
||||
break
|
||||
fi
|
||||
if [[ "$attempt" -eq 120 ]]; then
|
||||
echo "Timed out waiting for release PR #$RELEASE_PR to merge" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
gh workflow run release-please.yml --ref main
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9.15.9
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm build
|
||||
@@ -30,9 +30,8 @@ The frontend version comes from `package.json`. Production builds also embed the
|
||||
current Git commit. CI can override these values with `VITE_APP_VERSION` and
|
||||
`VITE_GIT_COMMIT`.
|
||||
|
||||
Releases are managed by Release Please. Use Conventional Commits such as
|
||||
`feat:` and `fix:`; the workflow automatically merges its release pull request,
|
||||
updates the version and changelog, and creates a `vX.Y.Z` tag.
|
||||
The FileCodeBox product release workflow builds the latest commit from this
|
||||
repository's default branch. Every push is also checked with a production build.
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
|
||||
Reference in new issue
Block a user