-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add copy of update-dist.yml to see if this fixes
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# When Dependabot updates dependency, this workflow synchronize the change | ||
# to the /dist dir to let users enjoy new feature without manual sync. | ||
name: Update the dist dir 2 | ||
on: | ||
pull | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
run-ncc: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
# if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
token: ${{ github.token }} # Replace github.token with PAT (personal access token) if you need to trigger a new workflow. https://git.io/JcHD9 | ||
- name: Use Node.js v16.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
# It is not suggested to cache for the pull_request_target event | ||
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target | ||
- name: Install dependencies | ||
run: yarn install --immutable | ||
- name: Update the dist directory | ||
run: | | ||
INPUT_TOKEN=${{ secrets.PERSONAL_ACCESS_TOKEN }} yarn run all | ||
if [[ $(git status -s -- dist | wc -l) -gt 0 ]]; then | ||
git add dist | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "chore: sync the dependency update to the /dist dir" | ||
git push origin HEAD | ||
fi | ||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --rebase "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |