Skip to content

Actions not triggering even with Custom App #2461

Closed
@Paddy-Farmeye

Description

Hi @peter-evans,

I'm aware of the original issue tracking the problem I'm having, and I've read your very good corresponding documentation. I've gone ahead and created a Github App and used it to provide a token ... however, I still can't seem to get actions to trigger.

My flow is as follows:

  • scheduled github action to create a PR with automerge enabled
  • when a PR is created two actions should occur (mergeable check, and build/test)
Screenshot 2023-10-20 at 11 45 01

The PR gets created with automerge enabled as expected.
The mergeable check also runs as expected ... but the build_and_test never kicks off.

I feel I've probably just missed something small and was hoping someone could just cast their eye over my config.

My config

Automerge PR config

name: Release
on:
  # update the main branch at 8pm (UTC)
  schedule:
    - cron: '0 20 * * 1-4'
  # or update the main branch manually
  workflow_dispatch:

jobs:
  createPullRequest:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎
        uses: actions/checkout@v4
        with:
          ref: main
          fetch-tags: true
          fetch-depth: 0

      - name: Fetch new tag version
        run: |
          git fetch --tags --prune --prune-tags
          VERSION=`git tag --sort=-creatordate | head -1`
          echo "Version ${VERSION}"

          #replace . with space so can split into an array
          VERSION_BITS=(${VERSION//./ })

          VNUM1=${VERSION_BITS[0]}
          VNUM2=${VERSION_BITS[1]}
          VNUM3=${VERSION_BITS[2]}
          VNUM3=$((VNUM3+1))

          #create new tag
          NEW_TAG="$VNUM1.$VNUM2.$VNUM3"

          echo "New Version ${NEW_TAG}"
          echo "version=${NEW_TAG}" >> $GITHUB_OUTPUT
          id: fetch-tag-version

      - name: Fetch Token
        uses: tibdex/github-app-token@v1
        id: generate-token
        with:
          app_id: ${{ secrets.TOKEN_APP_ID }}
          private_key: ${{ secrets.TOKEN_PRIVATE_KEY }}

      - name: Update main branch
        run: |
          git reset --hard origin/devel

      - name: Create Pull Request
        id: cpr
        uses: peter-evans/create-pull-request@v5
        with:
          token: ${{ steps.generate-token.outputs.token }}
          commit-message: Release ${{ steps.fetch-tag-version.outputs.version }}
          committer: GitHub <noreply@github.com>
          author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
          signoff: false
          branch: release
          base: main
          delete-branch: true
          title: Release ${{ steps.fetch-tag-version.outputs.version }}
          body: Release ${{ steps.fetch-tag-version.outputs.version }}
          draft: false

      - name: Pull Request Automerge
        if: steps.cpr.outputs.pull-request-operation == 'created'
        uses: peter-evans/enable-pull-request-automerge@v3
        with:
          pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
          merge-method: merge

build_and_test config

name: PR build Checks

on:
 pull_request:
    branches:
      - devel
      - release

jobs:
  build_and_test:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 11

    - name: Cache the Maven packages to speed up build
      uses: actions/cache@v1
      with:
        path: ~/.m2
        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
        restore-keys: ${{ runner.os }}-m2     
  
    - name: Build and test project with Maven
      run: mvn -B package --file pom.xml

Sorry for the inconvenience, hopefully it's something small I've overlooked.
Thank you

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions