Skip to content

Commit

Permalink
Fix CI issues checking out old commits (#467)
Browse files Browse the repository at this point in the history
The used `github.event.pull_request.merge_commit_sha` seems to be broken
and has the old commit always. Instead we try now use the
`github.event.pull_request.head.sha`. This is required because we use
secrets and need so use `pull_request_target` instead of `pull_request`
event which behaves differently.
  • Loading branch information
alexander-schranz authored Dec 27, 2024
1 parent 7f4ae32 commit 6b55f82
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/callable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
dependency-versions: 'highest'

steps:
- name: Wait for 5 seconds
run: sleep 5

- name: Output infos
run: |
echo "${{ github.event.pull_request.merge_commit_sha }}"
Expand All @@ -42,7 +39,7 @@ jobs:
- name: Checkout project
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
ref: "${{ github.event.pull_request.head.sha }}"

- name: Git infos
run: |
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Wait for 5 seconds
run: sleep 5
- name: Output infos
run: |
echo "${{ github.event.pull_request.merge_commit_sha }}"
echo "${{ github.event.pull_request.head.sha }}"
- uses: actions/checkout@v4
- name: Checkout project
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
ref: "${{ github.event.pull_request.head.sha }}"

- name: Git infos
run: |
git rev-parse HEAD
git branch --show-current
- uses: actions/setup-python@v5

Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Wait for 5 seconds
run: sleep 5
- name: Output infos
run: |
echo "${{ github.event.pull_request.merge_commit_sha }}"
echo "${{ github.event.pull_request.head.sha }}"
- name: Checkout project
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
ref: "${{ github.event.pull_request.head.sha }}"

- name: Git infos
run: |
git rev-parse HEAD
git branch --show-current
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions integrations/spiral/src/Console/ReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function __invoke(
EngineRegistry $engineRegistry,
): int {
/** @var \DateTimeImmutable|null $dateTimeBoundary */
$dateTimeBoundary = $this->datetimeBoundary ? new \DateTimeImmutable((string) $this->datetimeBoundary) : null;
$dateTimeBoundary = $this->datetimeBoundary ? new \DateTimeImmutable((string) $this->datetimeBoundary) : null; // @phpstan-ignore-line
/** @var array<string> $identifiers */
$identifiers = \array_filter(\explode(',', (string) $this->identifiers));
$identifiers = \array_filter(\explode(',', (string) $this->identifiers)); // @phpstan-ignore-line

$reindexConfig = ReindexConfig::create()
->withIndex($this->indexName)
Expand Down

0 comments on commit 6b55f82

Please sign in to comment.