enable-github-automerge-action
enable-github-automerge-action copied to clipboard
Action ran successfully but didn't enable auto-merge
I'm not sure if I'm correctly expecting what this action does, but imagined as this action is completed, I wouldn't need to click the Enable auto-merge (rebase) button by hand, which isn't happing for me. Did I set it up wrongfully?

Here's the action yaml
name: Base Action
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events
pull_request:
branches: ["*"]
types: [opened, synchronize]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Job "enable-auto-merge"
enable-auto-merge:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: alexwilson/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
merge-method: "REBASE"
Edit:
I enabled ACTION_STEP_DEBUG for the repo and got the below logs

Inspired by peter-evans/enable-pull-request-automerge's input description, I tried using a Personal Access Token and it worked for this action!
(required) A repo scoped Personal Access Token (PAT). Note: GITHUB_TOKEN does not work here.

I haven't actually thought this entirely through, but my gut feeling tells me PAT doesn't fit my workflow requirement somehow.
Is there something I'm missing to make GITHUB_TOKEN work? Or, is this intended now?
To put in more context, I tried using Github App token and got the same results of the original issue description.
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Enable Pull Request Automerge
uses: alexwilson/[email protected]
with:
github-token: "${{ steps.generate_token.outputs.token }}"
merge-method: "REBASE"
Hey, as far as I'm aware app tokens might not have permissions to perform this kind of action as there are restrictions at the app level. You should be able to use the native github_token variable though, does that help achieve the same effect?
Or rather: I believe you may need to do server-to-server OAuth, to get a token for the context of the installation which your repository sits under. Is that how you're retrieving this token?
If you aren't, and depending on how large the work to enable that behaviour is, it might be worth trying to implement this behaviour (I would personally find this behaviour useful!)
I haven't tried OAuth Apps. What I've tried so far are:
-
native
github_tokenvariable, screenshot in original issue body- uses: alexwilson/[email protected] with: github-token: "${{ secrets.GITHUB_TOKEN }}"You should be able to use the native
github_tokenvariable thoughSadly this isn't working :( Am I missing some context here?
-
PAT, works as expected, discussed in https://github.com/alexwilson/enable-github-automerge-action/issues/28#issuecomment-813801692
-
Github Apps, followed these steps to set up, doesn't work
app tokens might not have permissions to perform this kind of action as there are restrictions at the app level
I'm currently taking this as a fact now, maybe someday Github will make changes on this.