diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 810577b..5e722a2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,16 +8,18 @@ updates: - package-ecosystem: 'npm' # See documentation for possible values directory: '/' # Location of package manifests commit-message: - prefix: 'build' - include: 'scope' + prefix: 'deps' # packaged dependencies + prefix-development: 'build' # dev-dependencies + #include: 'scope' rebase-strategy: 'auto' schedule: interval: 'daily' - package-ecosystem: 'github-actions' # See documentation for possible values directory: '/' # Location of package manifests commit-message: - prefix: 'ci' - include: 'scope' + #prefix: 'ci' + prefix: 'ci(github-actions)' + #include: 'scope' rebase-strategy: 'auto' schedule: interval: 'daily' diff --git a/.github/workflows/dependabot-approve-and-auto-merge.yml b/.github/workflows/dependabot-approve-and-auto-merge.yml index e4b07a4..6e1fbe8 100644 --- a/.github/workflows/dependabot-approve-and-auto-merge.yml +++ b/.github/workflows/dependabot-approve-and-auto-merge.yml @@ -1,13 +1,47 @@ name: Dependabot Pull Request Approve and Merge -on: pull_request_target +on: pull_request #_target permissions: pull-requests: write contents: write jobs: + pull-request-title-change: + runs-on: ubuntu-latest + steps: + # Checkout the source code + - name: 'Checkout source code' + uses: actions/checkout@v4 + + - name: 'Fetch Dependabot metadata' + id: dependabot-fetch + uses: dependabot/fetch-metadata@v1 + + - name: 'Split title and update' + id: split-title + if: ${{ ! contains(github.event.pull_request.title, '):' ) && contains(github.event.pull_request.title, ':') && steps.dependabot-fetch.outcome == 'success' }} + env: + TITLE: ${{ github.event.pull_request.title }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{github.event.pull_request.html_url}} + run: | + echo $TITLE + title_pt2="${TITLE##*:}" + title_pt1="${TITLE%%:*}" + gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status` + packagename="${{ steps.dependabot-fetch.outputs.dependency-names }}" + echo "packagename is $packagename" + echo "$title_pt1" + echo "$title_pt2" + parensOpen="(" + parensClose="):" + pr_title=$title_pt1$parensOpen$packagename$parensClose$title_pt2 + echo "FINAL TITLE: $pr_title" + gh pr edit "$PR_URL" --title "$pr_title" + # Auto merge Dependabot PRs for: # - patch updates on prod dependencies # - minor updates on dev dependencies dependabot-auto-merge: + needs: pull-request-title-change # Only run for Dependabot PRs if: ${{ github.actor == 'dependabot[bot]' }} runs-on: ubuntu-latest diff --git a/.prettierrc b/.prettierrc index 3668b41..0940498 100755 --- a/.prettierrc +++ b/.prettierrc @@ -18,6 +18,10 @@ "files": "*.{cmp,page,component}", "options": { "parser": "html" } }, + { + "files": ".json", + "options": { "parser": "json", "printWidth": 80 } + }, { "files": "*.{yaml,yml}", "options": { "useTabs": false, "tabWidth": 2, "singleQuote": true } diff --git a/release-please-config.json b/release-please-config.json index 345028f..170d282 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -12,73 +12,21 @@ }, "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", "extra-files": [ - { - "type": "json", - "path": "package.json", - "jsonpath": "$.version" - } - ], - "plugins": [ - { - "type": "sentence-case" - } + { "type": "json", "path": "package.json", "jsonpath": "$.version" } ], + "plugins": [{ "type": "sentence-case" }], "changelog-sections": [ - { - "type": "feat", - "section": "Features", - "hidden": false - }, - { - "type": "fix", - "section": "Bug Fixes", - "hidden": false - }, - { - "type": "chore", - "section": "Chores", - "hidden": false - }, - { - "type": "perf", - "section": "Performance Improvements", - "hidden": false - }, - { - "type": "docs", - "section": "Documentation", - "hidden": false - }, - { - "type": "test", - "section": "Tests", - "hidden": false - }, - - { - "type": "ci", - "section": "Continuous Integration", - "hidden": false - }, - { - "type": "revert", - "section": "Reverts", - "hidden": false - }, - { - "type": "refactor", - "section": "Code Refactoring", - "hidden": false - }, - { - "type": "style", - "section": "Styles", - "hidden": false - }, - { - "type": "build", - "section": "Build System", - "hidden": true - } + { "type": "feat", "section": "Features", "hidden": false }, + { "type": "fix", "section": "Bug Fixes", "hidden": false }, + { "type": "chore", "section": "Chores", "hidden": false }, + { "type": "perf", "section": "Performance Improvements", "hidden": false }, + { "type": "docs", "section": "Documentation", "hidden": false }, + { "type": "test", "section": "Tests", "hidden": false }, + { "type": "revert", "section": "Reverts", "hidden": false }, + { "type": "refactor", "section": "Code Refactoring", "hidden": false }, + { "type": "style", "section": "Styles", "hidden": false }, + { "type": "deps", "section": "Dependencies", "hidden": false }, + { "type": "build", "section": "Build System", "hidden": true }, + { "type": "ci", "section": "Continuous Integration", "hidden": false } ] }