Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ntduan committed Jun 7, 2024
1 parent 7501158 commit 97955b8
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/update-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:

permissions:
contents: write # required for push commit
pull-requests: write # required for create pr

jobs:
update-env:
Expand All @@ -30,21 +31,11 @@ jobs:
cache: 'yarn'
- run: yarn --immutable
- run: yarn update-env
- name: Commit and Create PR
uses: actions/github-script@v6
with:
script: |
const branchName = `update-env-${context.sha.slice(0, 7)}`
await exec.exec(`git config user.email "41898282+github-actions[bot]@users.noreply.github.com"`)
await exec.exec(`git config user.name "github-actions[bot]"`)
await exec.exec(`git checkout -b ${branchName}`)
await exec.exec(`git`, ['commit', '-am', 'update env'])
await exec.exec(`git push origin HEAD:${branchName}`)
await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Update env',
head: branchName,
base: 'add-env',
body: 'Update env',
})
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add .
git diff --quiet || git commit -m "[CI Skip] Update KNOWN_GOOD_BLOCK_NUMBERS" && git push
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

0 comments on commit 97955b8

Please sign in to comment.