Skip to content

Commit

Permalink
Merge pull request #1 from gagoar/master
Browse files Browse the repository at this point in the history
Sync fork
  • Loading branch information
saakshaat-singh authored Apr 12, 2023
2 parents e0bcb7e + aeda4df commit 1146db7
Show file tree
Hide file tree
Showing 6 changed files with 2,115 additions and 132 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/rebuild_dist.yml
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}}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
16.17.0
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ outputs:
response: # id of output
description: "response from lambda invocation"
runs:
using: "node12"
using: "node16"
main: "dist/index.js"
Loading

0 comments on commit 1146db7

Please sign in to comment.