diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 978ae766..1aca7e79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: with: node-version: 16.x - name: Install dependencies - run: yarn install --check-files --frozen-lockfile + run: yarn install --check-files - name: build run: npx projen build - name: Find mutations @@ -52,6 +52,37 @@ jobs: with: name: build-artifact path: dist + self-mutation: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + if: always() && needs.build.outputs.self_mutation_happened && !(github.event.pull_request.head.repo.full_name != github.repository) + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.PROJEN_GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Download patch + uses: actions/download-artifact@v3 + with: + name: .repo.patch + path: ${{ runner.temp }} + - name: Apply patch + run: '[ -s ${{ runner.temp }}/.repo.patch ] && git apply ${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + - name: Set git identity + run: |- + git config user.name "github-actions" + git config user.email "github-actions@github.com" + - name: Push changes + env: + PULL_REQUEST_REF: ${{ github.event.pull_request.head.ref }} + run: |- + git add . + git commit -s -m "chore: self mutation" + git push origin HEAD:$PULL_REQUEST_REF package-js: needs: build runs-on: ubuntu-latest diff --git a/.projenrc.ts b/.projenrc.ts index 47c51be2..8e203580 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -41,6 +41,5 @@ const project = new awscdk.AwsCdkConstructLibrary({ copyrightPeriod: '2023-', copyrightOwner: 'Amazon.com, Inc. or its affiliates. All Rights Reserved.', gitignore: ['*.DS_STORE'], - mutableBuild: false, }); project.synth();