forked from ubiquity-os-marketplace/command-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: new token workflow for worker-deploy.yml
- Loading branch information
1 parent
e4eb972
commit b5ec0f3
Showing
1 changed file
with
39 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,45 +63,45 @@ jobs: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }} | ||
|
||
# - name: Update manifest.json worker url | ||
# uses: actions/github-script@v7 | ||
# with: | ||
# script: | | ||
# const fs = require('fs'); | ||
# const path = require('path'); | ||
# | ||
# const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json'); | ||
# const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); | ||
# | ||
# manifest["homepage_url"] = "${{ steps.wrangler_deploy.outputs.deployment-url }}"; | ||
# | ||
# const updatedManifest = JSON.stringify(manifest, null, 2); | ||
# fs.writeFileSync(manifestPath, updatedManifest); | ||
# console.log('Updated manifest:', updatedManifest); | ||
# | ||
# - name: Get GitHub App token | ||
# if: env.APP_ID != '' && env.APP_PRIVATE_KEY != '' | ||
# uses: actions/create-github-app-token@v1 | ||
# id: app-token | ||
# with: | ||
# app-id: ${{ env.APP_ID }} | ||
# private-key: ${{ env.APP_PRIVATE_KEY }} | ||
# | ||
# - name: Format manifest.json using Prettier | ||
# shell: bash | ||
# run: | | ||
# bun add -DE prettier | ||
# bun prettier --write . | ||
# | ||
# - name: Commit file | ||
# uses: swinton/[email protected] | ||
# env: | ||
# GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }} | ||
# with: | ||
# files: | | ||
# manifest.json | ||
# commit-message: "chore: update manifest.json url" | ||
# ref: ${{ github.ref }} | ||
- name: Update manifest.json worker url | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json'); | ||
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); | ||
manifest["homepage_url"] = "${{ steps.wrangler_deploy.outputs.deployment-url }}"; | ||
const updatedManifest = JSON.stringify(manifest, null, 2); | ||
fs.writeFileSync(manifestPath, updatedManifest); | ||
console.log('Updated manifest:', updatedManifest); | ||
- name: Get GitHub App token | ||
if: env.APP_ID != '' && env.APP_PRIVATE_KEY != '' | ||
uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ env.APP_ID }} | ||
private-key: ${{ env.APP_PRIVATE_KEY }} | ||
|
||
- name: Format manifest.json using Prettier | ||
shell: bash | ||
run: | | ||
bun add -DE prettier | ||
bun prettier --write . | ||
- name: Commit file | ||
uses: swinton/[email protected] | ||
env: | ||
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }} | ||
with: | ||
files: | | ||
manifest.json | ||
commit-message: "chore: update manifest.json url" | ||
ref: ${{ github.ref }} | ||
|
||
- name: Write Deployment URL to Summary | ||
run: | | ||
|