Skip to content

Commit

Permalink
Run CI with PR sources (#3479)
Browse files Browse the repository at this point in the history
* Run CI with PR sources

* Add CI branch to the pull_request_target

---------

Co-authored-by: Julien <[email protected]>
  • Loading branch information
jlestel and Julien authored Nov 22, 2023
1 parent eeed0a1 commit 8f5119f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/ghcr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "!.github/**"
branches: ["ci"]
pull_request_target:
branches: ["master"]
branches: ["master", "ci"]
paths:
- "**/*"
- "!.github/**" # Important: Exclude PRs related to .github from auto-run
Expand Down Expand Up @@ -39,8 +39,14 @@ jobs:
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request_target' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Buildx
uses: ./.github/actions/build
with:
Expand Down Expand Up @@ -75,8 +81,13 @@ jobs:
grafana:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request_target' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Login to GitHub Container Registry
uses: docker/[email protected]
Expand Down

0 comments on commit 8f5119f

Please sign in to comment.