diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml index 94e3e39..382db59 100644 --- a/.github/workflows/pull-request-lint.yml +++ b/.github/workflows/pull-request-lint.yml @@ -52,7 +52,7 @@ jobs: PR_BODY: ${{ github.event.pull_request.body }} EXPECTED: By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the [project license](https://github.com/${{ github.repository }}/blob/main/LICENSE). HELP: Contributor statement missing from PR description. Please include the following text in the PR description - if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && !(github.event.pull_request.user.login == 'awslabs-mcp' || github.event.pull_request.user.login == 'dependabot[bot]') + if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && !(github.event.pull_request.user.login == 'awslabs-mcp' || github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'github-actions' || github.event.pull_request.user.login == 'github-actions[bot]') steps: - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0 with: diff --git a/.github/workflows/upgrade-main.yml b/.github/workflows/upgrade-main.yml new file mode 100644 index 0000000..26c8c61 --- /dev/null +++ b/.github/workflows/upgrade-main.yml @@ -0,0 +1,122 @@ +name: upgrade-main + +on: + workflow_dispatch: {} + schedule: + - cron: "0 0 * * *" + +permissions: + actions: none + attestations: none + checks: none + contents: none + deployments: none + discussions: none + id-token: none + issues: none + models: none + packages: none + pages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none + +jobs: + upgrade: + name: Upgrade + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + patch_created: ${{ steps.create_patch.outputs.patch_created }} + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: main + + - name: Setup mise + uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 + with: + cache: true + + - name: Install tools + run: mise install + + - name: Upgrade dependencies + run: mise upgrade --bump + + - name: Find mutations + id: create_patch + run: |- + git add . + git diff --staged --patch --exit-code > repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT + shell: bash + working-directory: ./ + + - name: Upload patch + if: steps.create_patch.outputs.patch_created + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.4.0 + with: + name: repo.patch + path: repo.patch + overwrite: true + + pr: + name: Create Pull Request + needs: upgrade + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + if: ${{ needs.upgrade.outputs.patch_created }} + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: main + + - name: Download patch + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4.1.7 + 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[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Create Pull Request + uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v6 + with: + token: ${{ secrets.UPGRADE_MAIN_TOKEN }} + commit-message: |- + chore(deps): upgrade dependencies + + Upgrades project dependencies. See details in [workflow run]. + + [Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + + ------ + + *Automatically created by the "upgrade-main" workflow* + branch: github-actions/upgrade-main + title: "chore(deps): upgrade dependencies" + body: |- + Upgrades project dependencies. See details in [workflow run]. + + [Workflow Run]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + + ------ + + *Automatically created by the "upgrade-main" workflow* + author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + signoff: true + labels: dependencies