From 639660922848714a603142c906636135a78e1ec3 Mon Sep 17 00:00:00 2001 From: Zaran Lalvani Date: Fri, 10 May 2024 22:13:37 -0400 Subject: [PATCH] feat: marketplace action --- .github/workflows/bumpgen-core.yml | 26 +++++++++++++++++++ action.yml | 40 ++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/bumpgen-core.yml create mode 100644 action.yml diff --git a/.github/workflows/bumpgen-core.yml b/.github/workflows/bumpgen-core.yml new file mode 100644 index 0000000..720d7d8 --- /dev/null +++ b/.github/workflows/bumpgen-core.yml @@ -0,0 +1,26 @@ +name: "Bumpgen (core)" + +on: + pull_request: + types: + - opened + - labeled + +permissions: + pull-requests: read + +jobs: + main: + name: Run Bumpgen + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' || contains( github.event.pull_request.labels.*.name, 'run bumpgen') }} + steps: + - uses: actions/checkout@v4 + - name: Setup + uses: ./tooling/github/setup + - name: Bumpgen + uses: ./ + with: + path: "./packages/core/" + llm_key: ${{ secrets.LLM_API_KEY }} + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..fc01c38 --- /dev/null +++ b/action.yml @@ -0,0 +1,40 @@ +name: "bumpgen" +description: "handle breaking changes from dependency upgrades" +author: Xeol + +inputs: + path: + description: Repository path + required: false + default: "./" + llm_key: + description: "LLM API key" + required: true + github_token: + description: "GitHub token" + required: true + +runs: + using: "composite" + steps: + - shell: bash + env: + LLM_API_KEY: ${{ inputs.llm_key }} + run: | + npm install -g bumpgen + bumpgen --simple --dir ${{ inputs.path }} --no-upgrade --auto-detect + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Check for changes and commit + env: + GITHUB_TOKEN: ${{ inputs.github_token }} + run: | + git add -A + if ! git diff-index --quiet HEAD; then + git commit -m "chore: run bumpgen" + git push origin HEAD:${GITHUB_REF#refs/heads/} + else + echo "No changes to commit" + fi