diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d309829d39..9377223081 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,12 +5,11 @@ on: push: branches: - master - # for PRs from forked repos + # for PRs from forked repos and non forked repos # in order to write status info to the PR we require write repository token (https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/) pull_request_target: - types: [opened, synchronize, reopened] - # for PRs from ACS AEM Commons repository directly (non-forked repo) - pull_request: + branches: + - master types: [opened, synchronize, reopened] # restrict privileges except for setting commit status, adding PR comments and writing statuses @@ -45,9 +44,10 @@ jobs: steps: - name: Debug Event + env: + GH_EVENT: ${{ toJSON(github.event) }} shell: bash - run: - echo "Event that triggered action: ${{ github.event }}" + run: echo "Event that triggered the action $GH_EVENT" - name: Checkout uses: actions/checkout@v2 # always act on the modified source code (even for event pull_request_target) @@ -57,17 +57,10 @@ jobs: # no additional git operations after checkout triggered in workflow, no need to store credentials persist-credentials: false - - name: Set up cache for ~/.m2/repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: maven-${{ matrix.os }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - maven-${{ matrix.os }}- - - name: Set up JDK uses: actions/setup-java@v2 with: + cache: 'maven' distribution: 'adopt' java-version: ${{ matrix.jdk }} # generate settings.xml with the correct values