diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c6e9137..e7eaf76 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,3 +33,4 @@ jobs: org: 'runtimeverification' repo: ${{ matrix.value }} token: ${{ secrets.JENKINS_GITHUB_PAT }} + debug: true diff --git a/action.yaml b/action.yaml index 40533e6..b65dbdd 100644 --- a/action.yaml +++ b/action.yaml @@ -14,6 +14,10 @@ inputs: token: description: 'Access token to be able to write to the repository' required: true + debug: + description: 'Debug mode' + required: false + default: 'false' outputs: merged: value: ${{ steps.automerge.outputs.merged }} @@ -49,5 +53,5 @@ runs: env: GITHUB_TOKEN: ${{ inputs.token }} working-directory: tmp-${{ inputs.repo }} - run: python3 ${{ github.action_path }}/src/automerge.py --org ${{ inputs.org }} --repo ${{ inputs.repo }} + run: python3 ${{ github.action_path }}/src/automerge.py --org ${{ inputs.org }} --repo ${{ inputs.repo }} --dry-run ${{ inputs.debug }} diff --git a/src/automerge.py b/src/automerge.py index 0ad687e..fe5c814 100755 --- a/src/automerge.py +++ b/src/automerge.py @@ -98,13 +98,13 @@ def run_git_command(command_args: str) -> subprocess.CompletedProcess: # - Approved, and # - Up-to-date. # If so, merge -if automerge_up_to_date_prs: +while automerge_up_to_date_prs: pr = automerge_up_to_date_prs[0] _LOGGER.info(f' Merging PR:\n{pr_to_display_string(pr)}\n') if args.dry_run: _LOGGER.info(f'Would have merged PR:\n{pr_to_display_string(pr)}\n') else: - pr.merge(merge_method='squash') + pr.merge(merge_method='squash', merge_title=f'Auto Mergerge: {pr.number}', merge_message='Title: {pr.title}\nURL: {pr.html_url}\n') automerge_up_to_date_prs.pop(0) # 5. Get PRs that are: diff --git a/test/automerge.json b/test/automerge.json index ad2b806..ed6b8b0 100644 --- a/test/automerge.json +++ b/test/automerge.json @@ -1,3 +1,3 @@ [ - "devops-actions" + "automerger-test" ] \ No newline at end of file