Skip to content

Commit

Permalink
workflows/L4LB: Apply fixes to change detection logic
Browse files Browse the repository at this point in the history
Commit 98e6ea4 ("workflows: Improve the change check for issue_comment
triggers") and its subsequent fix (see previous commit) missed the L4LB
workflow. This commit fixes it by applying the same modifications to the
L4LB workflow.

Fix: 98e6ea4 ("workflows: Improve the change check for issue_comment triggers")
Signed-off-by: Paul Chaignon <paul@cilium.io>
  • Loading branch information
pchaigno authored and ti-mo committed Aug 17, 2021
1 parent 7b3453f commit 7b0b606
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/tests-l4lb-v1.10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,30 @@ jobs:
outputs:
tested: ${{ steps.tested-tree.outputs.src }}
steps:
- name: Retrieve pull request's base and head
if: ${{ github.event.issue.pull_request }}
id: pr
run: |
curl ${{ github.event.issue.pull_request.url }} > pr.json
echo "::set-output name=base::$(jq -r '.base.sha' pr.json)"
echo "::set-output name=head::$(jq -r '.head.sha' pr.json)"
# Because we run on issue comments, we need to checkout the code for
# paths-filter to work.
- name: Checkout code
if: ${{ github.event.issue.pull_request }}
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
persist-credentials: false
- name: Retrieve pull request's base and head
if: ${{ github.event.issue.pull_request }}
id: pr
run: |
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
${{ github.event.issue.pull_request.url }} > pr.json
commits_url=$(jq -r '.commits_url' pr.json)
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
${commits_url} > commits.json
pr_first_sha=$(jq -r ".[0].sha" commits.json)
pr_parent_sha=$(git rev-parse "${pr_first_sha}^")
echo "::set-output name=base::${pr_parent_sha}"
echo "::set-output name=head::$(jq -r '.head.sha' pr.json)"
- name: Check code changes
if: ${{ github.event.issue.pull_request }}
uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/tests-l4lb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,30 @@ jobs:
outputs:
tested: ${{ steps.tested-tree.outputs.src }}
steps:
- name: Retrieve pull request's base and head
if: ${{ github.event.issue.pull_request }}
id: pr
run: |
curl ${{ github.event.issue.pull_request.url }} > pr.json
echo "::set-output name=base::$(jq -r '.base.sha' pr.json)"
echo "::set-output name=head::$(jq -r '.head.sha' pr.json)"
# Because we run on issue comments, we need to checkout the code for
# paths-filter to work.
- name: Checkout code
if: ${{ github.event.issue.pull_request }}
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
persist-credentials: false
- name: Retrieve pull request's base and head
if: ${{ github.event.issue.pull_request }}
id: pr
run: |
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
${{ github.event.issue.pull_request.url }} > pr.json
commits_url=$(jq -r '.commits_url' pr.json)
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
${commits_url} > commits.json
pr_first_sha=$(jq -r ".[0].sha" commits.json)
pr_parent_sha=$(git rev-parse "${pr_first_sha}^")
echo "::set-output name=base::${pr_parent_sha}"
echo "::set-output name=head::$(jq -r '.head.sha' pr.json)"
- name: Check code changes
if: ${{ github.event.issue.pull_request }}
uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
Expand Down

0 comments on commit 7b0b606

Please sign in to comment.