Skip to content

Commit

Permalink
only trigger via pull_request_target
Browse files Browse the repository at this point in the history
debug event with toJSON function
fix yaml
use caching integrated in setup-java
  • Loading branch information
kwin committed Aug 25, 2021
1 parent 21b2487 commit bb7b2ef
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit bb7b2ef

Please sign in to comment.