-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix-offline
- Loading branch information
Showing
32 changed files
with
474 additions
and
277 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
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 |
---|---|---|
|
@@ -6,25 +6,8 @@ on: | |
push: | ||
|
||
jobs: | ||
check_command: | ||
runs-on: ubuntu-latest | ||
## skip if trigger by issue comment but not pr comment | ||
if: ${{ (github.event_name == 'issue_comment' && github.event.issue.pull_request) || github.event_name == 'push' }} | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Check for package command | ||
uses: xt0rted/slash-command-action@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
command: package | ||
reaction: "true" | ||
reaction-type: "eyes" | ||
allow-edits: "true" | ||
permission-level: write | ||
|
||
packaging: | ||
needs: [check_command] | ||
if: ${{ (github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/package')) || github.event_name == 'push' }} | ||
|
||
strategy: | ||
matrix: | ||
|
@@ -53,19 +36,11 @@ jobs: | |
uses: actions/checkout@v3 | ||
if: ${{ github.event_name == 'push' }} | ||
|
||
- name: Get PR Branch | ||
if: github.event_name == 'issue_comment' | ||
id: comment-branch | ||
uses: yanguoyu/[email protected] | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout for PR | ||
uses: actions/checkout@v3 | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
with: | ||
repository: ${{ steps.comment-branch.outputs.head_owner }}/${{ steps.comment-branch.outputs.head_repo }} | ||
ref: ${{ steps.comment-branch.outputs.head_ref }} | ||
ref: refs/pull/${{ github.event.issue.number }}/merge | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
|
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Update ckb node assume valid target | ||
|
||
on: | ||
pull_request: | ||
types: [ready_for_review] | ||
branches: | ||
- master | ||
|
||
jobs: | ||
ready-for-release: | ||
name: Update ckb node assume valid target | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Branch | ||
uses: peterjgrainger/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
branch: 'chore-update-valid-target/${{github.head_ref}}' | ||
sha: '${{ github.event.pull_request.head.sha }}' | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: 'chore-update-valid-target/${{github.head_ref}}' | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.12.0 | ||
|
||
- name: Write env file | ||
run: | | ||
npm run update:valid-target | ||
- name: Commit env file | ||
uses: actions/github-script@v6 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BASE: ${{ github.head_ref }} | ||
with: | ||
script: | | ||
const fs = require('node:fs') | ||
const { BASE, HEAD } = process.env | ||
const envFilePath = 'packages/neuron-wallet/.env' | ||
const destinationBranch = `chore-update-valid-target/${BASE}` | ||
const { data } = await github.rest.repos.getContent({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
path: envFilePath, | ||
ref: destinationBranch, | ||
}) | ||
await github.rest.repos.createOrUpdateFileContents({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
path: envFilePath, | ||
message: `chore: Update ckb node assume valid target for ${BASE}.`, | ||
content: fs.readFileSync(envFilePath).toString('base64'), | ||
sha: data.sha, | ||
branch: destinationBranch, | ||
}) | ||
- name: Create PR | ||
uses: actions/github-script@v6 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BASE: ${{github.head_ref}} | ||
HEAD: chore-update-valid-target/${{github.head_ref}} | ||
REPO: ${{github.repository}} | ||
with: | ||
script: | | ||
const { BASE, HEAD, REPO } = process.env | ||
const { data: pulls } = await github.rest.pulls.list({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}) | ||
if (pulls.some(pull => pull.head.ref === HEAD)) { | ||
return | ||
} | ||
github.rest.pulls.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
head: HEAD, | ||
base: BASE, | ||
title: 'chore: Update ckb node assume valid target', | ||
body: `This PR uses to update ckb node assume valid target for PR https://github.com/${REPO}/pull/${context.issue.number}`, | ||
}) |
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
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
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
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
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
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
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
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
Oops, something went wrong.