From 95bebb78a6e147c4909caba8434d9ff1bafcc6d3 Mon Sep 17 00:00:00 2001 From: Myyk Seok Date: Mon, 16 Oct 2023 15:41:29 +0800 Subject: [PATCH] chore: add copy of update-dist.yml to see if this fixes --- .github/workflows/update-dist-2.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/update-dist-2.yml diff --git a/.github/workflows/update-dist-2.yml b/.github/workflows/update-dist-2.yml new file mode 100644 index 00000000..c84c4b15 --- /dev/null +++ b/.github/workflows/update-dist-2.yml @@ -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 "action@github.com" + 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}}