Skip to content

Commit

Permalink
ci: Fix wrong ref in PR workflows which broke external builds (n8n-io…
Browse files Browse the repository at this point in the history
…#7431)

Github issue / Community forum post (link here to close automatically):
n8n-io#7423

This PR updates reference passed to the `checkout` action by the
`cy-pull-request.ym`. This should fix three existing issues:
- Failing unit tests for external pull requests
- Failing e2e tests for external PRs
- Passing empty `ref` to `lint` job which makes linter run on a wrong
branch
  • Loading branch information
MiloradFilipovic authored Oct 13, 2023
1 parent ec14141 commit 1fb5166
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3.5.3
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- uses: pnpm/action-setup@v2.4.0

Expand All @@ -37,7 +37,7 @@ jobs:
uses: ./.github/workflows/units-tests-reusable.yml
needs: install
with:
ref: ${{ github.event.pull_request.head.ref }}
ref: refs/pull/${{ github.event.pull_request.number }}/merge
cacheKey: ${{ github.sha }}-base:18-test-lint

lint:
Expand All @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v3.5.3
with:
repository: n8n-io/n8n
ref: ${{ inputs.branch }}
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- uses: pnpm/action-setup@v2.4.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: ./.github/workflows/e2e-reusable.yml
if: ${{ github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'community') }}
with:
branch: ${{ github.event.pull_request.head.ref }}
pr_number: ${{ github.event.pull_request.number }}
user: ${{ github.event.pull_request.user.login || 'PR User' }}
spec: 'e2e/*'
secrets:
Expand Down

0 comments on commit 1fb5166

Please sign in to comment.