From 7d8842a275baca92332b13f1409cceda8113e11d Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:34:55 +0330 Subject: [PATCH 1/8] refactor: use node 20 for build --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b3ab5d..d621bc3 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "start": "NODE_OPTIONS=--enable-source-maps run-s clean build serve", "build": "yarn build:es --analyze=verbose", "build:ts": "tsc --build", - "build:es": "esbuild src/index.ts --platform=node --external:simple-oauth2 --target=node19 --bundle --format=esm --minify --sourcemap --outdir=dist --out-extension:.js=.mjs", + "build:es": "esbuild src/index.ts --platform=node --external:simple-oauth2 --target=node20 --bundle --format=esm --minify --sourcemap --outdir=dist --out-extension:.js=.mjs", "clean": "rm -rf dist build .tsbuildinfo", "serve": "node --enable-source-maps dist/index.mjs", "serve:debug": "node --inspect --enable-source-maps dist/index.mjs", From 7f4dfafcaa2e49bdb76564b8f1c294fcae550694 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:38:27 +0330 Subject: [PATCH 2/8] ci: use major only version to prevent many update --- .github/workflows/publish-container.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml index c454a78..454bdf9 100644 --- a/.github/workflows/publish-container.yml +++ b/.github/workflows/publish-container.yml @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v4 - name: πŸ— Setup Docker Buildx - uses: docker/setup-buildx-action@v3.8.0 + uses: docker/setup-buildx-action@v3 - name: πŸ— Log into registry ${{ env.REGISTRY }} if: ${{ github.event_name != 'pull_request' }} @@ -49,7 +49,7 @@ jobs: - name: πŸ— Extract metadata id: meta - uses: docker/metadata-action@v5.6.1 + uses: docker/metadata-action@v5 if: ${{ github.event_name != 'pull_request' }} with: github-token: ${{secrets.GITHUB_TOKEN}} @@ -69,7 +69,7 @@ jobs: - name: πŸš€ Build and push container image id: build-and-push - uses: docker/build-push-action@v6.11.0 + uses: docker/build-push-action@v6 with: push: ${{ github.event_name != 'pull_request' }} github-token: ${{ secrets.GITHUB_TOKEN }} @@ -80,13 +80,3 @@ jobs: # build-args: | cache-from: type=gha cache-to: type=gha,mode=max - - # - name: πŸ— Install cosign - # if: ${{ github.event_name != 'pull_request' }} - # uses: sigstore/cosign-installer@v3.0.5 - - # - name: πŸ— Sign the published container image - # if: ${{github.event_name != 'pull_request'}} - # env: - # COSIGN_EXPERIMENTAL: 'true' - # run: echo "${{steps.meta.outputs.tags}}" | xargs -I {} cosign sign --yes {}@${{steps.build-and-push.outputs.digest}} From 7b5534f834b441f94167092e7557f7937fa5cfbe Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:38:34 +0330 Subject: [PATCH 3/8] ci: remove sync label --- .github/labels.yml | 83 ------------------------------- .github/workflows/sync-labels.yml | 30 ----------- 2 files changed, 113 deletions(-) delete mode 100644 .github/labels.yml delete mode 100644 .github/workflows/sync-labels.yml diff --git a/.github/labels.yml b/.github/labels.yml deleted file mode 100644 index e0e111f..0000000 --- a/.github/labels.yml +++ /dev/null @@ -1,83 +0,0 @@ -- name: 'breaking-change' - color: ee0701 - description: 'A change that changes the API or breaks backward compatibility for users.' -- name: 'bugfix' - color: ee0701 - description: 'Inconsistencies or issues which will cause a problem for users or implementors.' -- name: 'documentation' - color: 0052cc - description: 'Solely about the documentation of the project.' -- name: 'enhancement' - color: 1d76db - description: 'Enhancement of the code, not introducing new features.' -- name: 'refactor' - color: 1d76db - description: 'Updating the code with simpler, easier to understand or more efficient syntax or methods, but not introducing new features.' -- name: 'performance' - color: 1d76db - description: 'Improving performance of the project, not introducing new features.' -- name: 'new-feature' - color: 0e8a16 - description: 'New features or options.' -- name: 'maintenance' - color: 2af79e - description: 'Generic maintenance tasks.' -- name: 'ci' - color: 1d76db - description: 'Work that improves the continuous integration.' -- name: 'dependencies' - color: 1d76db - description: 'Change in project dependencies.' - -- name: 'in-progress' - color: fbca04 - description: 'Issue is currently being worked on by a developer.' -- name: 'stale' - color: fef2c0 - description: 'No activity for quite some time.' -- name: 'no-stale' - color: fef2c0 - description: 'This is exempt from the stale bot.' -- name: 'auto-closed' - color: fef2c0 - description: 'No activity for quite some time.' - -- name: 'security' - color: ee0701 - description: 'Addressing a vulnerability or security risk in this project.' -- name: 'incomplete' - color: fef2c0 - description: 'Missing information.' -- name: 'invalid' - color: fef2c0 - description: "This is off-topic, spam, or otherwise doesn't apply to this project." - -- name: 'good first issue' - color: 0e8a16 - description: 'Good first issue for people wanting to contribute to this project.' -- name: 'help-wanted' - color: 0e8a16 - description: 'We need some extra helping hands or expertise in order to resolve this!' - -- name: 'priority-critical' - color: ee0701 - description: 'Must be addressed as soon as possible.' -- name: 'priority-high' - color: b60205 - description: 'After critical issues are fixed, these should be dealt with before any further issues.' -- name: 'priority-medium' - color: 0e8a16 - description: 'This issue may be useful, and needs some attention.' -- name: 'priority-low' - color: e4ea8a - description: 'Nice addition, maybe... someday...' - -- name: 'major' - color: b60205 - description: 'This PR causes a major bump in the version number.' -- name: 'minor' - color: 0e8a16 - description: 'This PR causes a minor bump in the version number.' -- name: 'release' - color: 5319E7 - description: 'Release PR from next to main.' diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml deleted file mode 100644 index 2143369..0000000 --- a/.github/workflows/sync-labels.yml +++ /dev/null @@ -1,30 +0,0 @@ -# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json - -name: Sync labels - -on: - workflow_dispatch: - push: - branches: - - main - - next - paths: - - .github/labels.yml - -jobs: - labels: - name: Sync labels - runs-on: ubuntu-latest - - permissions: - contents: read - issues: write - - steps: - - name: ‡️ Check out code from GitHub - uses: actions/checkout@v4 - - - name: πŸš€ Run Label Syncer - uses: micnncim/action-label-syncer@v1.3.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b73441025b25d473c405bce67797847c89f57369 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:41:32 +0330 Subject: [PATCH 4/8] chore: switch to node 22 --- Dockerfile | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ec6fa6..0fef135 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG NODE_IMAGE=docker.io/library/node:20-alpine +ARG NODE_IMAGE=docker.io/library/node:22-alpine FROM $NODE_IMAGE as builder diff --git a/package.json b/package.json index d621bc3..5d54412 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "start": "NODE_OPTIONS=--enable-source-maps run-s clean build serve", "build": "yarn build:es --analyze=verbose", "build:ts": "tsc --build", - "build:es": "esbuild src/index.ts --platform=node --external:simple-oauth2 --target=node20 --bundle --format=esm --minify --sourcemap --outdir=dist --out-extension:.js=.mjs", + "build:es": "esbuild src/index.ts --platform=node --external:simple-oauth2 --target=node22 --bundle --format=esm --minify --sourcemap --outdir=dist --out-extension:.js=.mjs", "clean": "rm -rf dist build .tsbuildinfo", "serve": "node --enable-source-maps dist/index.mjs", "serve:debug": "node --inspect --enable-source-maps dist/index.mjs", From ecbf3252896d47c0ea5603e133deb546a380be85 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:41:40 +0330 Subject: [PATCH 5/8] ci: remove extra depdendabot config --- .github/dependabot.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 60e507b..1021a7b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,6 @@ version: 2 updates: - package-ecosystem: github-actions directory: / - open-pull-requests-limit: 20 commit-message: prefix: deps include: scope @@ -22,7 +21,6 @@ updates: - package-ecosystem: npm directory: / versioning-strategy: increase - open-pull-requests-limit: 20 commit-message: prefix: deps include: scope From ea585af28a9b3a8ce3c0b0e332349399b97b8605 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:45:16 +0330 Subject: [PATCH 6/8] chore: correct image title --- .github/workflows/publish-container.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml index 454bdf9..0e2d13d 100644 --- a/.github/workflows/publish-container.yml +++ b/.github/workflows/publish-container.yml @@ -57,8 +57,8 @@ jobs: labels: | org.opencontainers.image.authors=njfamirm@gmail.com - org.opencontainers.image.title=@alwatr/decap-cms-github-backend - org.opencontainers.image.description='Self-hosted decap cms github backend' + org.opencontainers.image.title=@njfamirm/decap-cms-github-backend + org.opencontainers.image.description='Self-hosted decap cms github backend.' tags: | type=semver,enable=true,pattern={{major}} From b68e828177b95ba027f931653fac0d64127a40bd Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:45:22 +0330 Subject: [PATCH 7/8] docs: some enhancement --- README.md | 2 +- package.json | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a8f3ea..5e7bc10 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Decap CMS Github backend -OAuth service as Github backend for Decap CMS. +OAuth service as Github backend for Decap CMS inspired by [netlify-cms-oauth](https://github.com/ublabs/netlify-cms-oauth) ## Usage diff --git a/package.json b/package.json index 5d54412..4019fad 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,7 @@ { - "name": "decap-cms-github-backend", - "author": "AdriΓ‘n UB", - "contributors": [ - "S. Amir Mohammad Najafi (https://www.njfamirm.ir)" - ], + "name": "@njfamirm/decap-cms-github-backend", + "author": "S. Amir Mohammad Najafi (https://www.njfamirm.ir)", + "description": "Self-hosted decap cms github backend.", "version": "1.1.0", "license": "MIT", "private": true, From fbb1aefaa32730bbabe3910883bb92ab66bfd2e3 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Fri, 10 Jan 2025 19:48:17 +0330 Subject: [PATCH 8/8] ci: set permission for build.yml --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1bed088..92d60c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,9 @@ env: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + steps: - name: ‡️ Checkout repository uses: actions/checkout@v4