forked from gagoar/invoke-aws-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from gagoar/master
Sync fork
- Loading branch information
Showing
6 changed files
with
2,115 additions
and
132 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,50 @@ | ||
name: rebuild dist/ if needed | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{github.head_ref}} | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
cache: 'npm' | ||
node-version-file: '.nvmrc' | ||
|
||
- run: npm install | ||
- name: build dist/ | ||
run: npm run build | ||
- run: | | ||
STATUS=$(git diff --quiet && echo clean || echo modified) | ||
echo "status=$(echo $STATUS)" >> $GITHUB_OUTPUT | ||
id: gitStatus | ||
- run: | | ||
echo ${{ steps.gitStatus.outputs.status }} | ||
echo ${{ contains(steps.gitStatus.outputs.status, 'modified') }} | ||
- name: Commit dist/ files | ||
if: contains(steps.gitStatus.outputs.status, 'modified') | ||
run: | | ||
set -x | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "rebuild dist/" -a | ||
- id: auth | ||
if: contains(steps.gitStatus.outputs.status, 'modified') | ||
uses: jnwng/github-app-installation-token-action@v2 | ||
with: | ||
appId: ${{ secrets.COMMIT_BUILD_TO_PR_APP_ID }} | ||
installationId: ${{ secrets.COMMIT_BUILD_TO_PR_INSTALLATION_ID }} | ||
privateKey: ${{ secrets.COMMIT_BUILD_TO_PR_PRIVATE_KEY }} | ||
- name: Push changes | ||
if: contains(steps.gitStatus.outputs.status, 'modified') | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ steps.auth.outputs.token }} | ||
branch: ${{github.head_ref}} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
16.16.0 | ||
16.17.0 |
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.