Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Apr 17, 2024
1 parent 9058379 commit 4c94e83
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 73 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/gh-pr-create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: gh pr create
on:
push:
branches: "main"
paths-ignore:
- README.md
- LICENSE
- .gitignore
- .github/**
- "!.github/workflows/gh-pr-create.yml"
schedule:
- cron: "41 */6 * * *"
workflow_dispatch:
concurrency: ${{ github.workflow }}
jobs:
gh-pr-create:
permissions:
contents: write
pull-requests: write
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions4git/setup-git@v1
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: npm
- run: npm ci
- run: npm run generate
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
branch="generate-$(jq -r '.version' package.json)"
if git rev-parse --verify "$branch"; then
git checkout -b "$branch"
git add -A && git commit -m 'Automated changes'
git push -u origin "$branch"
gh pr create --fill
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 0 additions & 70 deletions .github/workflows/npm-generate.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ on:
release:
types: released
workflow_dispatch:
workflow_call:
concurrency: ${{ github.workflow }}-npm-publish
concurrency: ${{ github.workflow }}
jobs:
npm-publish:
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion run.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function generate() {
console.log("updated package.json version to %o", newVersion);
}

const gfwVersion = package_.version.split("+")[1];
const gfwVersion = remoteGfwVersion;
const gitVersion = gfwVersion.match(/^\d+\.\d+\.\d+/)[0];
console.debug("gfw version %o", gfwVersion);
console.debug("git version %o", gitVersion);
Expand Down

0 comments on commit 4c94e83

Please sign in to comment.