Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Pull Request Target #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .github/workflows/pullrequest.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# for pull request the actions context is a little bit different. we always use the workflow as
# defined in the main branch, therefore any change in .github/workflow directory introduced by
# the PR is ignored. this happens because if leverage the "on: pull_request_target" instead of
# "on: pull_request". the only practical difference here is that when we checkout the source
# code we use the source repository (the repo used to open the pr), see "check out code" steps.
---
name: pullrequest

on:
pull_request_target:
pull_request:
branches:
- main

Expand Down Expand Up @@ -94,7 +89,7 @@ jobs:
uses: docker/login-action@v1
with:
registry: ghcr.io
username: shipwright-io
username: ${{ github.event.pull_request.user.login }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build image
Expand All @@ -104,7 +99,7 @@ jobs:
push: true
context: ./
file: ./Containerfile
tags: ghcr.io/shipwright-io/imgctrl:pr-${{ github.event.number }}
tags: ghcr.io/${{ github.event.pull_request.user.login }}/imgctrl:pr-${{ github.event.number }}

release:
name: release
Expand Down