Skip to content

Commit

Permalink
chore: dependabot automerge workflow (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
crystall-bitquill authored May 1, 2024
1 parent 9e1149f commit e8b67dd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/dependabot_auto_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dependabot Automerge

on:
pull_request:
branches:
- "main"

permissions:
contents: write
pull-requests: write

jobs:
dependabot-automerge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'

steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable PR auto-merge
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
13 changes: 0 additions & 13 deletions common/lib/plugin_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,6 @@ export class PluginService implements ErrorHandler, HostListProviderService {
this._currentClient.config = Object.fromEntries(props.entries());
}

replaceTargetClient(props: Map<string, any>): void {
const createClientFunc = this.getCurrentClient().getCreateClientFunc();
if (createClientFunc) {
if (this.getCurrentClient().targetClient) {
this.getCurrentClient().end();
}
const newTargetClient = createClientFunc(Object.fromEntries(props));
this.getCurrentClient().targetClient = newTargetClient;
return;
}
throw new AwsWrapperError("AwsClient is missing create target client function."); // This should not be reached
}

createTargetClient(props: Map<string, any>): any {
const createClientFunc = this.getCurrentClient().getCreateClientFunc();
const copy = WrapperProperties.removeWrapperProperties(Object.fromEntries(props.entries()));
Expand Down

0 comments on commit e8b67dd

Please sign in to comment.