Skip to content

Commit

Permalink
ci: fix tests on forks (#260)
Browse files Browse the repository at this point in the history
* [ci: debug github env again to get it working on forks](29dbacb)
* [ci: read PR head repo full_name](d81681b)
* [ci: use the PR slug if available](93d255b)
  • Loading branch information
balupton authored Oct 28, 2024
1 parent 91711b1 commit f557548
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions .github/workflows/dorothy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@ jobs:
github.event.pull_request.assignees:
${{ github.event_name == 'pull_request' && toJson( toJson(github.event.pull_request.assignees) != '[]' ) }}
github.repository:
${{ toJson(github.repository) }}
github.event.pull_request.head.repo.full_name:
${{ github.event_name == 'pull_request' && toJson(github.event.pull_request.head.repo.full_name) }}
github.event.pull_request.head.sha:
${{ github.event_name == 'pull_request' && toJson(github.event.pull_request.head.sha) }}
github.sha:
${{ toJson(github.sha) }}
github.ref
${{ toJson(github.ref) }}
resolved slug:
${{ toJson(github.event.pull_request.head.repo.full_name || github.repository) }}
resolved sha:
${{ toJson(github.event.pull_request.head.sha || github.sha) }}
github:
${{ false && toJson(github) }}
EGITHUB
login-shells-and-linting:
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && toJson(github.event.pull_request.draft) == 'false' && toJson(github.event.pull_request.state) == '"open"' && toJson(github.event.pull_request.assignees) != '[]' )
Expand All @@ -40,7 +64,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # prevent rate limiting
run: |
# ensure dorothy is cloned, and run command
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/install?slug=${{ github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')"
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/install?slug=${{ github.event.pull_request.head.repo.full_name || github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')"
- name: 'Dorothy Configure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # prevent rate limiting
Expand All @@ -58,7 +82,7 @@ jobs:
setup-util-dash
setup-util-ksh
setup-util-carapace
dorothy --slug=${{ github.repository }} install
dorothy --slug=${{ github.event.pull_request.head.repo.full_name || github.repository }} install
# nu -c 'echo $nu.loginshell-path'
- name: 'Dorothy Login Shell: bash'
shell: bash -leo pipefail {0}
Expand Down Expand Up @@ -148,7 +172,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # prevent rate limiting
run: |
# ensure dorothy is cloned, and run command
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/run?slug=${{ github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')" -- dorothy test
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/run?slug=${{ github.event.pull_request.head.repo.full_name || github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')" -- dorothy test
fresh-macos-test:
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && toJson(github.event.pull_request.draft) == 'false' && toJson(github.event.pull_request.state) == '"open"' && toJson(github.event.pull_request.assignees) != '[]' )
strategy:
Expand All @@ -166,7 +190,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # prevent rate limiting
run: |
# ensure dorothy is cloned, and run command
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/run?slug=${{ github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')" -- dorothy test
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/run?slug=${{ github.event.pull_request.head.repo.full_name || github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')" -- dorothy test
container-test:
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && toJson(github.event.pull_request.draft) == 'false' && toJson(github.event.pull_request.state) == '"open"' && toJson(github.event.pull_request.assignees) != '[]' )
runs-on: ubuntu-latest
Expand Down Expand Up @@ -238,4 +262,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # prevent rate limiting
run: |
# ensure dorothy is cloned, and run command
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/run?slug=${{ github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')" -- dorothy test
bash -c "$(curl -fsSL 'https://dorothy.bevry.me/run?slug=${{ github.event.pull_request.head.repo.full_name || github.repository }}&commit=${{ github.event.pull_request.head.sha || github.sha }}')" -- dorothy test

0 comments on commit f557548

Please sign in to comment.